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: Lasse Kärkkäi. <tr...@us...> - 2010-07-14 00:31:47
|
Module: performous
Branch: svg_caching
Commit: 4b9472ae964e0410c3550bb50d4a6cccff589460
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Jul 14 03:31:34 2010 +0300
Fix word alignment.
---
game/image.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/image.hh b/game/image.hh
index 194b064..5ff8a37 100644
--- a/game/image.hh
+++ b/game/image.hh
@@ -55,7 +55,7 @@ namespace {
break;
}
png_write_info(pngPtr, infoPtr);
- unsigned stride = (w * bpp + bpp) & ~bpp; // Number of bytes per row (word-aligned)
+ unsigned stride = (w * bpp + 3) & ~3; // Number of bytes per row (word-aligned)
unsigned pos = reverse ? h * stride : -stride;
for (unsigned y = 0; y < h; ++y) {
if(reverse)
|
|
From: Yoda-JM <yo...@us...> - 2010-07-13 20:55:29
|
Module: performous Branch: svg_caching Commit: dbfe45b507815e42299afbf721be613d19a3e9f2 Author: Vincent Le Ligeour <yo...@us...> Date: Tue Jul 13 22:52:20 2010 +0200 Added SVG caching feature --- game/fs.cc | 34 +++++++++++----- game/fs.hh | 6 +++ game/image.hh | 104 +++++++++++++++++++++++++++++++++----------------- game/main.cc | 2 +- game/surface.cc | 27 ++++++++++++- game/video_driver.cc | 2 + 6 files changed, 127 insertions(+), 48 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2010-07-13 18:16:17
|
Module: performous
Branch: master
Commit: 0682ec2fb913ef05927f7595e9fc9650f5680e3c
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Jul 13 20:15:47 2010 +0200
Worked around a bug in midi lyrics parsing
---
game/songparser-ini.cc | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 016ef4f..8bd6e7c 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -176,6 +176,16 @@ void SongParser::iniParse() {
n.end = midi.get_seconds(it2->end)+s.start;
n.notePrev = n.note = it2->note;
n.type = n.note > 100 ? Note::SLEEP : Note::NORMAL;
+ if(n.note == 116 || n.note == 103)
+ // n.type = Note::GOLDEN;
+ continue; // not yet managed by midi parser
+ else if(n.note == 124)
+ // n.type = Note::GOLDEN;
+ continue; // not yet managed by midi parser
+ else if(n.note > 100)
+ n.type = Note::SLEEP;
+ else
+ n.type = Note::NORMAL;
{
std::stringstream ss(it2->lyric);
convertToUTF8(ss);
|
|
From: Yoda-JM <yo...@us...> - 2010-07-11 09:45:08
|
Module: performous
Branch: master
Commit: 000f681de62ce7a75528f192d8c79b65ec772d07
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jul 11 11:44:44 2010 +0200
Removed godmode and solo color from fret (reported as disturbing)
---
game/guitargraph.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0be7a41..29ef04a 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -725,7 +725,7 @@ void GuitarGraph::draw(double time) {
float x = getFretX(fret);
float l = m_pressed_anim[fret + !m_drums].get();
// Get a color for the fret and adjust it if GodMode is on
- glColor4fv(colorize(color(fret), time));
+ glColor4fv(color(fret));
m_button.dimensions.center(time2y(0.0)).middle(x);
m_button.draw();
glColor3f(l, l, l);
@@ -782,7 +782,7 @@ void GuitarGraph::draw(double time) {
glutil::Color c(0.5f, 0.5f, 0.5f);
if (!joining(time)) {
// Get a color for the fret and adjust it if GodMode is on
- c = colorize(color(fret), it->begin);
+ c = color(fret);
if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
// Further adjust the color if the note is hit
c.r += glow * 0.2f;
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 20:27:43
|
Module: performous
Branch: joinmenu
Commit: cac8b33763a04e8ea354472389628c0c9573b300
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 23:26:43 2010 +0300
Tighter instrument menu layout.
---
game/dancegraph.cc | 6 +++---
game/guitargraph.cc | 8 ++++----
game/instrumentgraph.cc | 11 +++++------
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ba829d9..6a09a19 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -127,9 +127,9 @@ void DanceGraph::setupJoinMenu() {
}
void DanceGraph::updateJoinMenu() {
- std::string s(" (");
- m_trackComment = _("Select track to play") + s + getTrack() + ")";
- m_difficultyComment = _("Select difficulty level") + s + getDifficultyString() + ")";
+ std::string s("\n (");
+ m_trackComment = _("Select track") + s + getTrack() + ")";
+ m_difficultyComment = _("Select difficulty") + s + getDifficultyString() + ")";
m_selectedTrack = ConfigItem(getTrack());
m_selectedDifficulty = ConfigItem(m_level);
}
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 48e2a72..6898f31 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -155,11 +155,11 @@ void GuitarGraph::setupJoinMenu() {
}
void GuitarGraph::updateJoinMenu() {
- std::string s(" (");
+ std::string s("\n (");
std::string le = m_leftymode.b() ? _("ON") : _("OFF");
- m_trackComment = _("Select track to play") + s + getTrack() + ")";
- m_difficultyComment = _("Select difficulty level") + s + getDifficultyString() + ")";
- m_leftyComment = _("Toggle left-handed mode") + s + le + ")";
+ m_trackComment = _("Select track") + s + getTrack() + ")";
+ m_difficultyComment = _("Select difficulty") + s + getDifficultyString() + ")";
+ m_leftyComment = _("Toggle lefty-mode") + s + le + ")";
m_selectedTrack = ConfigItem(getTrack());
m_selectedDifficulty = ConfigItem(m_level);
}
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index 7dcc6bc..ce67f74 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -31,10 +31,9 @@ InstrumentGraph::InstrumentGraph(Audio& audio, Song const& song, input::DevType
void InstrumentGraph::setupPauseMenu() {
m_menu.clear();
- // TODO: Replace with options that actually do something
m_menu.add(MenuOption(_("Resume"), _("Back to performing!")));
- //m_menu.add(MenuOption(_("Pause"), _("Toggle pause"), &InstrumentGraph::togglePause));
- m_menu.add(MenuOption(_("Restart"), _("Start the song from the beginning")));
+ // TODO: Implement restart
+ //m_menu.add(MenuOption(_("Restart"), _("Start the song\nfrom the beginning")));
m_menu.add(MenuOption(_("Quit"), _("Exit to song browser"), "Songs"));
}
@@ -55,8 +54,8 @@ void InstrumentGraph::toggleMenu(bool forceopen) {
void InstrumentGraph::drawMenu(double offsetX) {
if (m_menu.empty()) return;
- float step = 0.075;
- float y = -0.5 * m_menu.getOptions().size() * step;
+ float step = 0.05;
+ float y = -0.6 * m_menu.getOptions().size() * step;
// Some helper vars
ThemeInstrumentMenu& th = *m_menuTheme;
MenuOptions::const_iterator cur = static_cast<MenuOptions::const_iterator>(&m_menu.current());
@@ -75,7 +74,7 @@ void InstrumentGraph::drawMenu(double offsetX) {
if (cur->getComment() != "") {
//th.comment_bg.dimensions.middle().screenBottom(-0.2);
//th.comment_bg.draw();
- th.comment.dimensions.middle(-0.15 + offsetX).screenBottom(-0.2);
+ th.comment.dimensions.middle(-0.1 + offsetX).screenBottom(-0.22);
th.comment.draw(cur->getComment());
}
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 19:00:58
|
Module: performous
Branch: joinmenu
Commit: 59d7017c58374b4c24463401abbc6da5cfe163c0
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 21:57:53 2010 +0300
Menu theming stuff.
* Add dedicated theme files for instrument menu.
* Rename menu_* --> mainmenu_*
* Update nsis script.
* Still needs actual theming.
---
game/instrumentgraph.cc | 3 +-
game/theme.cc | 28 ++++++++++----------
game/theme.hh | 2 +-
...light.svg => instrumentmenu_back_highlight.svg} | 0
...hort_comment.svg => instrumentmenu_comment.svg} | 28 ++++++++++----------
.../{menu_option.svg => instrumentmenu_option.svg} | 0
...cted.svg => instrumentmenu_option_selected.svg} | 0
...k_highlight.svg => mainmenu_back_highlight.svg} | 0
.../{menu_comment.svg => mainmenu_comment.svg} | 0
...menu_comment_bg.svg => mainmenu_comment_bg.svg} | 0
.../{menu_option.svg => mainmenu_option.svg} | 0
...n_selected.svg => mainmenu_option_selected.svg} | 0
...nu_scomment_bg.svg => mainmenu_scomment_bg.svg} | 0
...hort_comment.svg => mainmenu_short_comment.svg} | 0
win32/setup.nsi | 26 ++++++++++--------
15 files changed, 45 insertions(+), 42 deletions(-)
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 18:32:42
|
Module: performous
Branch: joinmenu
Commit: fc87927320d7744ad5496702e395668e0512db24
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 21:29:01 2010 +0300
Menu now remembers where it was previously when exiting submenu.
---
game/instrumentgraph.cc | 2 +-
game/menu.cc | 47 ++++++++++++++++++++++-------------------------
game/menu.hh | 11 ++++-------
game/screen_intro.cc | 6 +++---
4 files changed, 30 insertions(+), 36 deletions(-)
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index 7240bb7..3629f66 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -59,7 +59,7 @@ void InstrumentGraph::drawMenu(double offsetX) {
float y = -0.5 * m_menu.getOptions().size() * step;
// Some helper vars
ThemeInstrumentMenu& th = *m_menuTheme;
- MenuOptions::const_iterator cur = m_menu.current();
+ MenuOptions::const_iterator cur = static_cast<MenuOptions::const_iterator>(&m_menu.current());
// Loop through menu items
for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it) {
SvgTxtTheme* txt = &th.option;
diff --git a/game/menu.cc b/game/menu.cc
index e1b78f6..8f08e63 100644
--- a/game/menu.cc
+++ b/game/menu.cc
@@ -61,50 +61,46 @@ MenuOption::MenuOption(const std::string& nm, const std::string& comm, const std
Menu::Menu():
- m_open(true),
- m_level(0)
+ m_open(true)
{
- menu_stack.push_back(&root_options);
- current_it = menu_stack.back()->end();
+ clear();
}
void Menu::add(MenuOption opt) {
root_options.push_back(opt);
- menu_stack.clear();
- menu_stack.push_back(&root_options);
- current_it = menu_stack.back()->begin(); // Reset iterator
+ clear(true); // Adding resets menu stack
}
void Menu::move(int dir) {
- if (dir > 0 && current_it != (--menu_stack.back()->end())) ++current_it;
- else if (dir < 0 && current_it != menu_stack.back()->begin()) --current_it;
+ if (dir > 0 && selection_stack.back() < menu_stack.back()->size() - 1) ++selection_stack.back();
+ else if (dir < 0 && selection_stack.back() > 0) --selection_stack.back();
}
void Menu::action(int dir) {
- switch (current_it->type) {
+ switch (current().type) {
case MenuOption::OPEN_SUBMENU:
- if (current_it->options.empty()) break;
- menu_stack.push_back(¤t_it->options);
- current_it = menu_stack.back()->begin();
- m_level++;
+ if (current().options.empty()) break;
+ menu_stack.push_back(¤t().options);
+ selection_stack.push_back(0);
break;
case MenuOption::CHANGE_VALUE:
- if (current_it->value) {
- if (dir > 0) ++(*(current_it->value));
- else if (dir < 0) --(*(current_it->value));
+ if (current().value) {
+ if (dir > 0) ++(*(current().value));
+ else if (dir < 0) --(*(current().value));
}
break;
case MenuOption::SET_AND_CLOSE:
- if (current_it->value) *(current_it->value) = current_it->newValue;
+ if (current().value) *(current().value) = current().newValue;
// Fall-through to closing
case MenuOption::CLOSE_SUBMENU:
- if (menu_stack.size() > 1) menu_stack.pop_back();
- else close();
- current_it = menu_stack.back()->begin();
+ if (menu_stack.size() > 1) {
+ menu_stack.pop_back();
+ selection_stack.pop_back();
+ } else close();
break;
case MenuOption::ACTIVATE_SCREEN:
ScreenManager* sm = ScreenManager::getSingletonPtr();
- std::string screen = current_it->newValue.s();
+ std::string screen = current().newValue.s();
clear();
if (screen.empty()) sm->finished();
else sm->activateScreen(screen);
@@ -112,9 +108,10 @@ void Menu::action(int dir) {
}
}
-void Menu::clear() {
+void Menu::clear(bool save_root) {
+ if (!save_root) root_options.clear();
menu_stack.clear();
- root_options.clear();
+ selection_stack.clear();
menu_stack.push_back(&root_options);
- current_it = menu_stack.back()->end();
+ selection_stack.push_back(0);
}
diff --git a/game/menu.hh b/game/menu.hh
index 9877e38..ab5e883 100644
--- a/game/menu.hh
+++ b/game/menu.hh
@@ -62,28 +62,25 @@ struct Menu {
/// adjust the selected value
void action(int dir = 1);
/// clear items
- void clear();
+ void clear(bool save_root = false);
bool empty() const { return (menu_stack.empty() || (menu_stack.size() == 1 && menu_stack.back()->empty())); }
bool isOpen() const { return m_open; }
void open() { m_open = true; }
void close() { m_open = false; }
void toggle() { m_open = !m_open; }
- void moveToLast() { current_it = --(menu_stack.back()->end()); }
+ void moveToLast() { selection_stack.back() = menu_stack.back()->size() - 1; }
+ MenuOption& current() { return menu_stack.back()->at(selection_stack.back()); }
MenuOption& back() { return root_options.back(); }
- MenuOptions::iterator& currentRef() { return current_it; }
- const MenuOptions::const_iterator current() const { return current_it; }
const MenuOptions::const_iterator begin() const { return menu_stack.back()->begin(); }
const MenuOptions::const_iterator end() const { return menu_stack.back()->end(); }
const MenuOptions getOptions() const { return *menu_stack.back(); }
private:
- MenuOptions::iterator current_it;
MenuOptions root_options;
SubmenuStack menu_stack;
+ std::vector<size_t> selection_stack;
bool m_open;
- int m_level;
-
};
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 7775457..5496a1b 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -49,7 +49,7 @@ void ScreenIntro::manageEvent(SDL_Event event) {
void ScreenIntro::draw_menu_options() {
int i = 0;
for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it, ++i) {
- if (m_menu.current() == it) {
+ if (static_cast<MenuOptions::const_iterator>(&m_menu.current()) == it) {
theme->back_h.dimensions.left(-0.4).center(-0.097 + i*0.08);
theme->back_h.draw();
theme->option_selected.dimensions.left(-0.35).center(-0.1 + i*0.08);
@@ -63,11 +63,11 @@ void ScreenIntro::draw_menu_options() {
void ScreenIntro::draw() {
theme->bg.draw();
- m_menu.current()->image->draw();
+ m_menu.current().image->draw();
theme->comment_bg.dimensions.center().screenBottom(-0.01);
theme->comment_bg.draw();
theme->comment.dimensions.left(-0.48).screenBottom(-0.028);
- theme->comment.draw(m_menu.current()->getComment());
+ theme->comment.draw(m_menu.current().getComment());
draw_menu_options();
if (m_dialog) m_dialog->draw();
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 18:32:40
|
Module: performous Branch: joinmenu Commit: f6c39cfb3cf6ce95068e97928bf1f4cb588809c3 Author: Tapio Vierros <tap...@gm...> Date: Thu Jul 8 20:46:00 2010 +0300 Menu changes. * Name and comment can optionally be dynamic * Join menu is now only re-created if necessary (track change) * Submenu stack changed to pointers to keep root easily synced --- game/dancegraph.cc | 19 +++++++++++++--- game/dancegraph.hh | 1 + game/guitargraph.cc | 30 +++++++++++++++++-------- game/guitargraph.hh | 1 + game/instrumentgraph.cc | 6 ++-- game/instrumentgraph.hh | 7 +++++- game/menu.cc | 54 +++++++++++++++++++++++++++------------------- game/menu.hh | 40 +++++++++++++++++++++------------- game/screen_intro.cc | 6 ++-- 9 files changed, 106 insertions(+), 58 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-07-08 16:23:04
|
Module: performous
Branch: joinmenu
Commit: 33de4c23cb98a3f7f4b50354fd1cd43853a87794
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 19:21:29 2010 +0300
Support unlimited submenu levels.
Also fix a mistake in previous navigation commit.
---
game/joystick.cc | 2 +-
game/menu.cc | 34 +++++++++++++++++++++-------------
game/menu.hh | 15 ++++++++-------
3 files changed, 30 insertions(+), 21 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 82e65a1..d30b33e 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -474,7 +474,7 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if (pickPressed[0]) return true; // repeating
pickPressed[0] = true;
event.type = input::Event::PICK;
- button = 1;
+ button = 0;
is_guitar_event = true;
break;
case SDLK_RSHIFT:
diff --git a/game/menu.cc b/game/menu.cc
index 3fab361..e71ec37 100644
--- a/game/menu.cc
+++ b/game/menu.cc
@@ -50,24 +50,32 @@ MenuOption::MenuOption(const std::string& nm, const std::string& comm, const std
}
+Menu::Menu():
+ m_open(true),
+ m_level(0)
+{
+ menu_stack.push_back(root_options);
+ current_it = menu_stack.back().end();
+}
void Menu::add(MenuOption opt) {
root_options.push_back(opt);
- options = root_options; // Set active menu to root
- current_it = options.begin(); // Reset iterator
+ menu_stack.clear();
+ menu_stack.push_back(root_options);
+ current_it = menu_stack.back().begin(); // Reset iterator
}
void Menu::move(int dir) {
- if (dir > 0 && current_it != (--options.end())) ++current_it;
- else if (dir < 0 && current_it != options.begin()) --current_it;
+ if (dir > 0 && current_it != (--menu_stack.back().end())) ++current_it;
+ else if (dir < 0 && current_it != menu_stack.back().begin()) --current_it;
}
void Menu::action(int dir) {
switch (current_it->type) {
case MenuOption::OPEN_SUBMENU:
if (current_it->options.empty()) break;
- options = current_it->options;
- current_it = options.begin();
+ menu_stack.push_back(current_it->options);
+ current_it = menu_stack.back().begin();
m_level++;
break;
case MenuOption::CHANGE_VALUE:
@@ -80,15 +88,14 @@ void Menu::action(int dir) {
if (current_it->value) *(current_it->value) = current_it->newValue;
// Fall-through to closing
case MenuOption::CLOSE_SUBMENU:
- // TODO: Handle more than one level of submenus
- if (m_level == 0) close();
- else m_level--;
- options = root_options;
- current_it = options.begin();
+ if (menu_stack.size() > 1) menu_stack.pop_back();
+ else close();
+ current_it = menu_stack.back().begin();
break;
case MenuOption::ACTIVATE_SCREEN:
ScreenManager* sm = ScreenManager::getSingletonPtr();
std::string screen = current_it->newValue.s();
+ clear();
if (screen.empty()) sm->finished();
else sm->activateScreen(screen);
break;
@@ -96,7 +103,8 @@ void Menu::action(int dir) {
}
void Menu::clear() {
- options.clear();
+ menu_stack.clear();
root_options.clear();
- current_it = options.end();
+ menu_stack.push_back(root_options);
+ current_it = menu_stack.back().end();
}
diff --git a/game/menu.hh b/game/menu.hh
index 21ba3d9..6b11de8 100644
--- a/game/menu.hh
+++ b/game/menu.hh
@@ -11,6 +11,7 @@ class Surface;
struct MenuOption;
typedef std::vector<MenuOption> MenuOptions;
+typedef std::vector<MenuOptions> SubmenuStack;
/// struct for menu options
struct MenuOption {
@@ -44,7 +45,7 @@ struct MenuOption {
/// Menu for selecting difficulty etc.
struct Menu {
/// constructor
- Menu(): current_it(options.end()), m_open(true), m_level(0) { }
+ Menu();
/// add a menu option
void add(MenuOption opt);
/// move the selection
@@ -54,23 +55,23 @@ struct Menu {
/// clear items
void clear();
- bool empty() const { return options.empty(); }
+ bool empty() const { return (menu_stack.empty() || (menu_stack.size() == 1 && menu_stack.back().empty())); }
bool isOpen() const { return m_open; }
void open() { m_open = true; }
void close() { m_open = false; }
void toggle() { m_open = !m_open; }
- void moveToLast() { current_it = --(options.end()); }
+ void moveToLast() { current_it = --(menu_stack.back().end()); }
MenuOptions::iterator& currentRef() { return current_it; }
const MenuOptions::const_iterator current() const { return current_it; }
- const MenuOptions::const_iterator begin() const { return options.begin(); }
- const MenuOptions::const_iterator end() const { return options.end(); }
- const MenuOptions getOptions() const { return options; }
+ const MenuOptions::const_iterator begin() const { return menu_stack.back().begin(); }
+ const MenuOptions::const_iterator end() const { return menu_stack.back().end(); }
+ const MenuOptions getOptions() const { return menu_stack.back(); }
private:
MenuOptions::iterator current_it;
- MenuOptions options;
MenuOptions root_options;
+ SubmenuStack menu_stack;
bool m_open;
int m_level;
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 16:23:00
|
Module: performous
Branch: joinmenu
Commit: a839bba5a254c7fe8f717bd1bd86716dbb12da0e
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 18:45:24 2010 +0300
Don't enter into an empty submenu.
---
game/menu.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/menu.cc b/game/menu.cc
index d01b578..3fab361 100644
--- a/game/menu.cc
+++ b/game/menu.cc
@@ -65,6 +65,7 @@ void Menu::move(int dir) {
void Menu::action(int dir) {
switch (current_it->type) {
case MenuOption::OPEN_SUBMENU:
+ if (current_it->options.empty()) break;
options = current_it->options;
current_it = options.begin();
m_level++;
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 16:22:59
|
Module: performous
Branch: joinmenu
Commit: 95fa380393074aa4049580103b43d3c81ac6a423
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 18:40:57 2010 +0300
Modify instrument menu navigation.
---
game/guitargraph.cc | 10 +++++-----
game/joystick.cc | 2 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 75746bd..bf62484 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -283,11 +283,11 @@ void GuitarGraph::engine() {
if (menuOpen()) {
bool old_lefty = m_leftymode.b();
// Check first regular keys
- if (ev.type == input::Event::PRESS && ev.button == 0 + m_drums) m_menu.action(1);
- else if (ev.type == input::Event::PRESS && ev.button == 1 + m_drums) m_menu.action(-1);
- else if (ev.type == input::Event::PRESS && ev.button == 2 + m_drums) m_menu.move(1);
- else if (ev.type == input::Event::PRESS && ev.button == 3 + m_drums) m_menu.move(-1);
- // Strum
+ if (ev.type == input::Event::PRESS && ev.button == 0) m_menu.action(1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 4 : 1)) m_menu.action(-1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 1 : 2)) m_menu.move(1);
+ else if (ev.type == input::Event::PRESS && ev.button == (m_drums ? 2 : 3)) m_menu.move(-1);
+ // Strum (strum of keyboard as guitar doesn't generate nav-events)
else if (ev.type == input::Event::PICK && ev.button == 0) m_menu.move(1);
else if (ev.type == input::Event::PICK && ev.button == 1) m_menu.move(-1);
else { // Try nav keys (arrows)
diff --git a/game/joystick.cc b/game/joystick.cc
index 08661fb..82e65a1 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -482,7 +482,7 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if (pickPressed[1]) return true; // repeating
pickPressed[1] = true;
event.type = input::Event::PICK;
- button = 0;
+ button = 1;
is_guitar_event = true;
break;
case SDLK_BACKSPACE:
|
|
From: Tapio V. <aa...@us...> - 2010-07-08 14:59:25
|
Module: performous
Branch: joinmenu
Commit: 06cbf09faa2896fe91bd073c7ee642aa0ffa50c5
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jul 8 17:58:51 2010 +0300
Lefty-mode can now be enabled via the menu.
---
game/guitargraph.cc | 6 +++++-
game/guitargraph.hh | 4 ++--
game/menu.hh | 2 +-
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 899b4b2..75746bd 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -146,9 +146,11 @@ void GuitarGraph::setupJoinMenu() {
}
// Populate root menu
std::string s(" (");
+ std::string le = m_leftymode.b() ? _("ON") : _("OFF");
m_menu.add(MenuOption(_("Ready!"), _("Start performing!")));
m_menu.add(MenuOption(_("Track"), _("Select track to play") + s + getTrack() + ")", trackmenu));
m_menu.add(MenuOption(_("Difficulty"), _("Select difficulty level") + s + getDifficultyString() + ")", diffmenu));
+ m_menu.add(MenuOption(_("Lefty-mode"), _("Toggle left-handed mode") + s + le + ")", &m_leftymode));
m_menu.add(MenuOption(_("Quit"), _("Exit to song browser"), "Songs"));
}
@@ -272,13 +274,14 @@ void GuitarGraph::engine() {
if (ev.type == input::Event::WHAMMY) whammy = (1.0 + ev.button + 2.0*(rand()/double(RAND_MAX))) / 4.0;
} else {
// Handle drum lefty-mode
- if (m_leftymode && ev.button > 0) ev.button = m_pads - ev.button;
+ if (m_leftymode.b() && ev.button > 0) ev.button = m_pads - ev.button;
}
// Keypress anims
if (ev.type == input::Event::PRESS) m_pressed_anim[!m_drums + ev.button].setValue(1.0);
else if (ev.type == input::Event::PICK) m_pressed_anim[0].setValue(1.0);
// Menu keys
if (menuOpen()) {
+ bool old_lefty = m_leftymode.b();
// Check first regular keys
if (ev.type == input::Event::PRESS && ev.button == 0 + m_drums) m_menu.action(1);
else if (ev.type == input::Event::PRESS && ev.button == 1 + m_drums) m_menu.action(-1);
@@ -294,6 +297,7 @@ void GuitarGraph::engine() {
// See if anything changed
if (m_selectedTrack.s() != getTrack()) setTrack(m_selectedTrack.s());
else if (m_selectedDifficulty.i() != m_level) difficulty(Difficulty(m_selectedDifficulty.i()));
+ else if (old_lefty != m_leftymode.b()) setupJoinMenu();
// Playing
} else if (m_drums) {
if (ev.type == input::Event::PRESS) drumHit(time, ev.button);
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index a8f853c..622441e 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -98,7 +98,7 @@ class GuitarGraph: public InstrumentGraph {
// Flags
bool m_drums; /// are we using drums?
bool m_use3d; /// are we using 3d?
- bool m_leftymode; /// switch guitar notes to right-to-left direction
+ ConfigItem m_leftymode; /// switch guitar notes to right-to-left direction
bool m_practmode; /// switch to enable practice mode
// Track stuff
@@ -126,7 +126,7 @@ class GuitarGraph: public InstrumentGraph {
void drawNote(int fret, glutil::Color, float tBeg, float tEnd, float whammy = 0, bool tappable = false, bool hit = false, double hitAnim = 0.0, double releaseTime = 0.0);
void drawDrumfill(float tBeg, float tEnd);
void drawInfo(double time, double offsetX, Dimensions dimensions);
- float getFretX(int fret) const { return (-2.0f + fret- (m_drums ? 0.5 : 0)) * (m_leftymode ? -1 : 1); }
+ float getFretX(int fret) { return (-2.0f + fret- (m_drums ? 0.5 : 0)) * (m_leftymode.b() ? -1 : 1); }
// Chords & notes
void updateChords();
diff --git a/game/menu.hh b/game/menu.hh
index 947feef..21ba3d9 100644
--- a/game/menu.hh
+++ b/game/menu.hh
@@ -8,7 +8,7 @@
#include <vector>
class Surface;
-class MenuOption;
+struct MenuOption;
typedef std::vector<MenuOption> MenuOptions;
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 19:41:51
|
Module: performous Branch: joinmenu Commit: 0ee98bb48cc6b95ab25f2956cb0561a34e62f2a5 Author: Tapio Vierros <tap...@gm...> Date: Wed Jul 7 22:40:29 2010 +0300 Track/difficulty selection menus based on submenu approach. --- game/dancegraph.cc | 63 +++++++++++++++++++++++++++++++++++----------- game/dancegraph.hh | 5 +++- game/guitargraph.cc | 43 ++++++++++++++++++++++++++----- game/guitargraph.hh | 4 ++- game/instrumentgraph.cc | 6 +--- game/instrumentgraph.hh | 2 + 6 files changed, 95 insertions(+), 28 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:50
|
Module: performous Branch: joinmenu Commit: 9e0a8d2d5107af2484dbdddc5c5d74232d945b7e Author: Tapio Vierros <tap...@gm...> Date: Wed Jul 7 20:06:25 2010 +0300 Merge branch 'master' into joinmenu Conflicts: game/dancegraph.cc --- |
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:47
|
Module: performous
Branch: joinmenu
Commit: db8e0e4ab54c3fd063d036dbc8e388d0d4b77980
Author: Tapio Vierros <tap...@gm...>
Date: Wed Jul 7 20:03:20 2010 +0300
Use getters for Menu's current and options + add some helpers.
---
game/instrumentgraph.cc | 15 +++++++++------
game/menu.cc | 28 ++++++++++++++--------------
game/menu.hh | 14 +++++++++++---
game/screen_intro.cc | 10 +++++-----
4 files changed, 39 insertions(+), 28 deletions(-)
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index 72b4ebb..b6a71f4 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -56,13 +56,16 @@ void InstrumentGraph::toggleMenu(bool forceopen) {
void InstrumentGraph::drawMenu(double offsetX) {
- if (m_menu.options.empty()) return;
+ if (m_menu.empty()) return;
float step = 0.075;
- float y = -0.5 * m_menu.options.size() * step;
+ float y = -0.5 * m_menu.getOptions().size() * step;
+ // Some helper vars
ThemeInstrumentMenu& th = *m_menuTheme;
- for (MenuOptions::iterator it = m_menu.options.begin(); it != m_menu.options.end(); ++it) {
+ MenuOptions::const_iterator cur = m_menu.current();
+ // Loop through menu items
+ for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it) {
SvgTxtTheme* txt = &th.option;
- if (m_menu.current == it) {
+ if (cur == it) {
//th.back_h.dimensions.middle(0.05 + offsetX).center(y);
//th.back_h.draw();
txt = &th.option_selected;
@@ -72,11 +75,11 @@ void InstrumentGraph::drawMenu(double offsetX) {
y += step;
}
- if (m_menu.current->comment != "") {
+ if (cur->comment != "") {
//th.comment_bg.dimensions.middle().screenBottom(-0.2);
//th.comment_bg.draw();
th.comment.dimensions.middle(-0.1 + offsetX).screenBottom(-0.2);
- th.comment.draw(m_menu.current->comment);
+ th.comment.draw(cur->comment);
}
}
diff --git a/game/menu.cc b/game/menu.cc
index 9d3d625..d01b578 100755
--- a/game/menu.cc
+++ b/game/menu.cc
@@ -53,41 +53,41 @@ MenuOption::MenuOption(const std::string& nm, const std::string& comm, const std
void Menu::add(MenuOption opt) {
root_options.push_back(opt);
- options = root_options; // Set current menu to root
- current = options.begin(); // Reset iterator
+ options = root_options; // Set active menu to root
+ current_it = options.begin(); // Reset iterator
}
void Menu::move(int dir) {
- if (dir > 0 && current != (--options.end())) ++current;
- else if (dir < 0 && current != options.begin()) --current;
+ if (dir > 0 && current_it != (--options.end())) ++current_it;
+ else if (dir < 0 && current_it != options.begin()) --current_it;
}
void Menu::action(int dir) {
- switch (current->type) {
+ switch (current_it->type) {
case MenuOption::OPEN_SUBMENU:
- options = current->options;
- current = options.begin();
+ options = current_it->options;
+ current_it = options.begin();
m_level++;
break;
case MenuOption::CHANGE_VALUE:
- if (current->value) {
- if (dir > 0) ++(*(current->value));
- else if (dir < 0) --(*(current->value));
+ if (current_it->value) {
+ if (dir > 0) ++(*(current_it->value));
+ else if (dir < 0) --(*(current_it->value));
}
break;
case MenuOption::SET_AND_CLOSE:
- if (current->value) *(current->value) = current->newValue;
+ if (current_it->value) *(current_it->value) = current_it->newValue;
// Fall-through to closing
case MenuOption::CLOSE_SUBMENU:
// TODO: Handle more than one level of submenus
if (m_level == 0) close();
else m_level--;
options = root_options;
- current = options.begin();
+ current_it = options.begin();
break;
case MenuOption::ACTIVATE_SCREEN:
ScreenManager* sm = ScreenManager::getSingletonPtr();
- std::string screen = current->newValue.s();
+ std::string screen = current_it->newValue.s();
if (screen.empty()) sm->finished();
else sm->activateScreen(screen);
break;
@@ -97,5 +97,5 @@ void Menu::action(int dir) {
void Menu::clear() {
options.clear();
root_options.clear();
- current = options.end();
+ current_it = options.end();
}
diff --git a/game/menu.hh b/game/menu.hh
index 0df839e..947feef 100755
--- a/game/menu.hh
+++ b/game/menu.hh
@@ -44,7 +44,7 @@ struct MenuOption {
/// Menu for selecting difficulty etc.
struct Menu {
/// constructor
- Menu(): current(options.end()), m_open(true), m_level(0) { }
+ Menu(): current_it(options.end()), m_open(true), m_level(0) { }
/// add a menu option
void add(MenuOption opt);
/// move the selection
@@ -54,16 +54,24 @@ struct Menu {
/// clear items
void clear();
+ bool empty() const { return options.empty(); }
bool isOpen() const { return m_open; }
void open() { m_open = true; }
void close() { m_open = false; }
void toggle() { m_open = !m_open; }
+ void moveToLast() { current_it = --(options.end()); }
+ MenuOptions::iterator& currentRef() { return current_it; }
+ const MenuOptions::const_iterator current() const { return current_it; }
+ const MenuOptions::const_iterator begin() const { return options.begin(); }
+ const MenuOptions::const_iterator end() const { return options.end(); }
+ const MenuOptions getOptions() const { return options; }
+
+ private:
+ MenuOptions::iterator current_it;
MenuOptions options;
MenuOptions root_options;
- MenuOptions::iterator current;
- private:
bool m_open;
int m_level;
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 5fd406b..9cbff7e 100755
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -38,7 +38,7 @@ void ScreenIntro::manageEvent(SDL_Event event) {
input::NavButton nav(input::getNav(event));
if (nav != input::NONE) {
if (m_dialog) { m_dialog.reset(); return; }
- if (nav == input::CANCEL) m_menu.current = --(m_menu.options.end()); // Move cursor to quit
+ if (nav == input::CANCEL) m_menu.moveToLast(); // Move cursor to quit
else if (nav == input::DOWN || nav == input::RIGHT || nav == input::MOREDOWN) m_menu.move(1);
else if (nav == input::UP || nav == input::LEFT || nav == input::MOREUP) m_menu.move(-1);
else if (nav == input::START) m_menu.action();
@@ -48,8 +48,8 @@ void ScreenIntro::manageEvent(SDL_Event event) {
void ScreenIntro::draw_menu_options() {
int i = 0;
- for (MenuOptions::iterator it = m_menu.options.begin(); it != m_menu.options.end(); ++it, ++i) {
- if (m_menu.current == it) {
+ for (MenuOptions::const_iterator it = m_menu.begin(); it != m_menu.end(); ++it, ++i) {
+ if (m_menu.current() == it) {
theme->back_h.dimensions.left(-0.4).center(-0.097 + i*0.08);
theme->back_h.draw();
theme->option_selected.dimensions.left(-0.35).center(-0.1 + i*0.08);
@@ -63,11 +63,11 @@ void ScreenIntro::draw_menu_options() {
void ScreenIntro::draw() {
theme->bg.draw();
- m_menu.current->image->draw();
+ m_menu.current()->image->draw();
theme->comment_bg.dimensions.center().screenBottom(-0.01);
theme->comment_bg.draw();
theme->comment.dimensions.left(-0.48).screenBottom(-0.028);
- theme->comment.draw(m_menu.current->comment);
+ theme->comment.draw(m_menu.current()->comment);
draw_menu_options();
if (m_dialog) m_dialog->draw();
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:45
|
Module: performous
Branch: joinmenu
Commit: cf96cf8b35d132aeb81f1a6fb4cc7205cdd09076
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jul 5 22:43:36 2010 +0300
Add enabled() to MidiDrums (in style of Webcam and Gettext) + fix some whitespace.
---
game/joystick.cc | 32 ++++++++++++++++----------------
game/joystick.hh | 2 ++
game/main.cc | 6 +-----
3 files changed, 19 insertions(+), 21 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 8c1cf66..02d016d 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -22,30 +22,30 @@ input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_i
static const int DRUM3_BLUE = 3; // low tom/ ride cymbal
static const int DRUM4_GREEN = 4; // low floor tom/ crash cymbal
- map[35] = DRUM0_ORANGE; // 35 - Acoustic Bass Drum
+ map[35] = DRUM0_ORANGE; // 35 - Acoustic Bass Drum
map[36] = DRUM0_ORANGE; // 36 - Bass Drum 1 *)
- map[37] = DRUM1_RED; // 37 - Side Stick
- map[38] = DRUM1_RED; // 38 - Acoustic Snare *)
- // 39 - Hand Clap
- map[40] = DRUM1_RED; // 40 - Electric Snare
+ map[37] = DRUM1_RED; // 37 - Side Stick
+ map[38] = DRUM1_RED; // 38 - Acoustic Snare *)
+ // 39 - Hand Clap
+ map[40] = DRUM1_RED; // 40 - Electric Snare
map[41] = DRUM4_GREEN; // 41 - Low Floor Tom *)
- map[42] = DRUM2_YELLOW; // 42 - Closed Hi-Hat
- // 43 - High Floor Tom
+ map[42] = DRUM2_YELLOW; // 42 - Closed Hi-Hat
+ // 43 - High Floor Tom
// 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
+ // 47 - Low-Mid Tom
map[48] = DRUM2_YELLOW; // 48 - Hi-Mid Tom *)
map[49] = DRUM4_GREEN; // 49 - Crash Cymbal 1 *)
// 50 - High Tom
map[51] = DRUM3_BLUE; // 51 - Ride Cymbal 1 *)
// 52 - Chinese Cymbal
- // 53 - Ride Bell
- // 54 - Tambourine
- // 55 - Splash Cymbal
- // 56 - Cowbell
- map[57] = DRUM4_GREEN; // 57 - Crash Cymbal 2
- // 58 - Vibraslap
+ // 53 - Ride Bell
+ // 54 - Tambourine
+ // 55 - Splash Cymbal
+ // 56 - Cowbell
+ map[57] = DRUM4_GREEN; // 57 - Crash Cymbal 2
+ // 58 - Vibraslap
map[59] = DRUM3_BLUE; // 59 - Ride Cymbal 2
// 60 - Hi Bongo
// 61 - Low Bongo
@@ -56,7 +56,7 @@ input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_i
// 66 - Low Timbale
// 67 - High Agogo
// 68 - Low Agogo
- // 69 - Cabasa
+ // 69 - Cabasa
// 70 - Maracas
// 71 - Short Whistle
// 72 - Long Whistle
@@ -91,7 +91,7 @@ void input::MidiDrums::process() {
unsigned char note = ev.message >> 8;
unsigned char vel = ev.message >> 16;
#if 0
- // it is IMHO not a good idea to filter on the channel.
+ // it is IMHO not a good idea to filter on the channel.
// code snippet left here for visibility
unsigned char chan = ev.message & 0x0F;
if (chan != 0x09) continue; // only accept channel 10 (percussion)
diff --git a/game/joystick.hh b/game/joystick.hh
index ab12136..d8086ae 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -160,6 +160,7 @@ namespace input {
#ifdef USE_PORTMIDI
class MidiDrums {
public:
+ static bool enabled() { return true; }
MidiDrums();
void process();
private:
@@ -172,6 +173,7 @@ namespace input {
#else
class MidiDrums {
public:
+ static bool enabled() { return false; }
MidiDrums() {};
void process() {};
private:
diff --git a/game/main.cc b/game/main.cc
index e577384..0d1f585 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -406,11 +406,7 @@ void outputOptionalFeatureStatus() {
std::cout << " Internationalization: " <<
(Gettext::enabled() ? "Enabled" : "Disabled")
<< std::endl << " MIDI I/O: " <<
- #ifdef USE_PORTMIDI
- "Enabled"
- #else
- "Disabled"
- #endif
+ (input::MidiDrums::enabled() ? "Enabled" : "Disabled")
<< std::endl << " Webcam support: " <<
(Webcam::enabled() ? "Enabled" : "Disabled")
<< std::endl;
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:42
|
Module: performous
Branch: joinmenu
Commit: 2c2aeaa2abee6a18e173599371db5b15778df3c7
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Jul 6 10:44:13 2010 +0200
Added new theme file to windows NSI
---
win32/setup.nsi | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/win32/setup.nsi b/win32/setup.nsi
index 9c4c359..220d217 100644
--- a/win32/setup.nsi
+++ b/win32/setup.nsi
@@ -226,6 +226,7 @@ Section "SezionePrincipale" SEC01
File "${FILES_PATH}\themes\default\songs_order.svg"
File "${FILES_PATH}\themes\default\songs_song.svg"
File "${FILES_PATH}\themes\default\star.svg"
+ File "${FILES_PATH}\themes\default\star_glow.svg"
File "${FILES_PATH}\themes\default\tail.svg"
File "${FILES_PATH}\themes\default\tail_drumfill.svg"
File "${FILES_PATH}\themes\default\tail_glow.svg"
@@ -285,6 +286,7 @@ Section Uninstall
Delete "$INSTDIR\themes\default\tail_glow.svg"
Delete "$INSTDIR\themes\default\tail_drumfill.svg"
Delete "$INSTDIR\themes\default\tail.svg"
+ Delete "$INSTDIR\themes\default\star_glow.svg"
Delete "$INSTDIR\themes\default\star.svg"
Delete "$INSTDIR\themes\default\songs_song.svg"
Delete "$INSTDIR\themes\default\songs_order.svg"
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:40
|
Module: performous
Branch: joinmenu
Commit: d6d3a4991e7d1735c8242aca92893afe626cf99a
Author: Felix Bertram <fl...@be...>
Date: Mon Jul 5 16:08:32 2010 -0700
bugfix for multiple audio devices in config
when multiple audio devices where specified in the config file, the code did not stop to use a device that was successfully opened. This patch fixes the behavior and stops at the first devices that can be opened.
---
game/main.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 91aed77..e577384 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,6 +145,9 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
+ // when we get here, we have successfully opened a device.
+ // let's use it then!
+ break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:38
|
Module: performous
Branch: joinmenu
Commit: 6bb7de2655d6ab9039b7ae7a538548f31a3e5595
Author: Felix Bertram <fl...@be...>
Date: Mon Jul 5 12:50:47 2010 -0700
Revert "Slowdown play"
create new features in separate branch
This reverts commit c783bf544100b9501830fd34c256ac9e30324b8a.
---
game/audio.cc | 44 +++++++++-----------------------------------
game/audio.hh | 7 ++-----
game/guitargraph.cc | 4 +---
game/main.cc | 2 --
game/screen_sing.cc | 8 ++------
game/screen_sing.hh | 1 -
6 files changed, 14 insertions(+), 52 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index 18824d8..ae4acfb 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -5,7 +5,6 @@
#include <libda/fft.hpp> // For M_PI
#include <cmath>
#include <iostream>
-#include <boost/filesystem.hpp>
struct SampleStream {
SampleStream(boost::shared_ptr<FFmpeg> const& mpeg): m_mpeg(mpeg) {}
@@ -76,39 +75,19 @@ void Audio::play(Sample const& s, std::string const& volumeSetting) {
m_mixer.add(da::shared_ref(acc));
}
-void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos, int speed) {
+void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos) {
if (!isOpen()) return;
da::lock_holder l = m_mixer.lock();
fadeout(fadeTime);
boost::shared_ptr<da::chain> ch(new da::chain());
for(std::map<std::string,std::string>::const_iterator it = filenames.begin() ; it != filenames.end() ; ++it ) {
- std::string f;
try {
- f = it->second;
- if (speed != 100) {
- // instead of real-time time-stretching we use previously created files
- // best effects have been achieved with SBSMS library
- // as used by Audacity's Sliding Time Scale/ Pitch Shift plugin
- std::string f2 = "-" + boost::lexical_cast<std::string>(speed) + ".ogg";
- f.replace(f.find(".ogg"), 4, f2);
- // std::cout << "loading time-stretched audio (" << f << ")" << std::endl;
-
- if (!boost::filesystem::exists(f)) throw std::runtime_error("time-stretched file \"" + f +"\" not found");
- }
-
- boost::shared_ptr<Stream> s(new Stream(f, m_rs.rate()));
+ boost::shared_ptr<Stream> s(new Stream(it->second, m_rs.rate()));
m_streams[it->first] = s;
ch->add(da::shared_ref(s));
s->seek(startPos);
} catch (std::runtime_error& e) {
- if (speed != 100) {
- // in case time-stretching failed let's retry at normal speed
- // TODO: we could also auto-create time-stretched files here
- playMusic(filenames, preview, fadeTime, startPos, 100);
- return;
- }
- // in case we are at normal speed we skip this file and try to continue
- std::cerr << "Error loading " << f << " (" << e.what() << ")" << std::endl;
+ std::cerr << "Error loading " << it->second << " (" << e.what() << ")" << std::endl;
continue;
}
}
@@ -117,14 +96,12 @@ void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool p
ch->add(boost::ref(m_volume));
m_mixer.fadein(da::shared_ref(ch), fadeTime, startPos);
if (!preview) pause(false);
-
- m_speed = speed;
}
-void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos, int speed) {
+void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos) {
std::map<std::string,std::string> tmp;
tmp["unidentified"] = filename;
- playMusic(tmp, preview, fadeTime, startPos, speed);
+ playMusic(tmp, preview, fadeTime, startPos);
}
void Audio::stopMusic() {
@@ -143,13 +120,12 @@ void Audio::fadeout(double fadeTime) {
double Audio::getPosition() const {
da::lock_holder l = m_mixer.lock();
- // only the audio slows down; the game still uses original time base
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos() * m_speed/100.0;
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos();
}
double Audio::getLength() const {
da::lock_holder l = m_mixer.lock();
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration() * m_speed/100.0;
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration();
}
bool Audio::isPlaying() const {
@@ -157,16 +133,14 @@ bool Audio::isPlaying() const {
return m_streams.empty() ? false : !m_streams.begin()->second->eof();
}
-void Audio::seek(double offset2) {
- double offset = offset2 * 100.0/m_speed;
+void Audio::seek(double offset) {
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(clamp(it->second->pos() + offset, 0.0, it->second->duration()));
pause(false);
}
-void Audio::seekPos(double pos2) {
- double pos = pos2 * 100.0/m_speed;
+void Audio::seekPos(double pos) {
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(pos);
diff --git a/game/audio.hh b/game/audio.hh
index d441cb1..e4f701f 100644
--- a/game/audio.hh
+++ b/game/audio.hh
@@ -94,9 +94,9 @@ class Audio {
* @param fadeTime time to fade
* @param startPos starting position
*/
- void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
+ void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
/// plays a list of songs
- void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
+ void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
/// plays a sample
void play(Sample const& s, std::string const& volumeSetting);
/// get pause status
@@ -107,8 +107,6 @@ class Audio {
void fadeout(double time = 1.0);
/** Get the length of the currently playing song, in seconds. **/
double getLength() const;
- /// return current speed
- int getSpeed() {return m_speed;}
/**
* This methods seek forward in the stream (backwards if
* argument is negative), and continues playing.
@@ -139,6 +137,5 @@ class Audio {
std::string m_volumeSetting;
da::mixer m_mixer;
std::map<std::string,boost::shared_ptr<Stream> > m_streams;
- int m_speed;
};
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0fdf6aa..0be7a41 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -185,9 +185,7 @@ bool GuitarGraph::difficulty(Difficulty level) {
/// Core engine
void GuitarGraph::engine() {
double time = m_audio.getPosition();
- // need to compensate for speed as well. When playing at half speed,
- // 1 second from getPosition is actually two seconds in real time
- time -= config["audio/controller_delay"].f() * m_audio.getSpeed()/100.0;
+ time -= config["audio/controller_delay"].f();
// Handle key markers
if (!m_drums) {
for (int i = 0; i < m_pads; ++i) {
diff --git a/game/main.cc b/game/main.cc
index 03da057..91aed77 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,8 +145,6 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
- // when we get here, we have successfully opened a device. let's use it!
- break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 0b52e85..dd822f3 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -31,7 +31,6 @@ namespace {
void ScreenSing::enter() {
//m_practmode = true; // un-comment this line to play with practice mode. temporary, of course!
- m_speed = 75; // 75% slow-down; falls back to 100% if time-stretch files are not found. temporary, of course!
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->flashMessage(_("Loading song..."), 0.0, 1.0, 0.5);
sm->drawFlashMessage(); sm->window().swap(); // Make loading message show
@@ -86,7 +85,6 @@ void ScreenSing::enter() {
theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_capture.analyzers();
m_layout_singer.reset(new LayoutSinger(m_song->vocals, m_database, theme));
-
// Load instrument and dance tracks
{
int type = 0; // 0 for dance, 1 for guitars, 2 for drums
@@ -110,7 +108,7 @@ void ScreenSing::enter() {
}
// Startup delay for instruments is longer than for singing only
double setup_delay = (m_instruments.empty() && m_dancers.empty() ? -1.0 : -8.0);
- m_audio.playMusic(m_song->music, false, 0.0, setup_delay, m_speed);
+ m_audio.playMusic(m_song->music, false, 0.0, setup_delay);
m_engine.reset(new Engine(m_audio, m_song->vocals, analyzers.begin(), analyzers.end(), m_database));
}
@@ -319,9 +317,7 @@ void ScreenSing::draw() {
// Get the time in the song
double length = m_audio.getLength();
double time = m_audio.getPosition();
- // need to compensate for speed as well. When playing at half speed,
- // 1 second from getPosition is actually two seconds in real time
- time -= config["audio/video_delay"].f() * m_audio.getSpeed()/100.0;
+ time -= config["audio/video_delay"].f();
double songPercent = clamp(time / length);
// Rendering starts
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 16cff8e..c743877 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -93,6 +93,5 @@ class ScreenSing: public Screen {
AnimValue m_quitTimer;
bool m_only_singers_alive;
bool m_practmode;
- int m_speed; // speed in percent, 100 for normal, 50 for half
};
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:35
|
Module: performous Branch: joinmenu Commit: d51a1ea094c57ed0357791e70e253e498606f9f8 Author: Tapio Vierros <tap...@gm...> Date: Mon Jul 5 21:46:14 2010 +0300 Refactor song parsers. * Move long constructor to a new .cc file. * Move duplicate helper functions to one place. * Use Boost for case conversions. --- game/songparser-ini.cc | 16 +----- game/songparser-sm.cc | 31 +---------- game/songparser-txt.cc | 23 +-------- game/songparser.cc | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ game/songparser.hh | 111 +++++---------------------------------- 5 files changed, 157 insertions(+), 161 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:32
|
Module: performous Branch: joinmenu Commit: 2e763d3921ad673cdc0e9ae48b7ec1b7429c4dab Author: Tapio Vierros <tap...@gm...> Date: Mon Jul 5 20:42:11 2010 +0300 Every singer now gets colored stars individually. --- game/notegraph.cc | 38 ++++---- game/notegraph.hh | 1 + game/notes.hh | 6 +- game/player.cc | 7 +- themes/default/star_glow.svg | 209 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 240 insertions(+), 21 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:30
|
Module: performous
Branch: joinmenu
Commit: c783bf544100b9501830fd34c256ac9e30324b8a
Author: Felix Bertram <fl...@be...>
Date: Sun Jul 4 14:43:37 2010 -0700
Slowdown play
- uses pre-created time-stretched audio files
- minimal changes to code, uses warped time-base
---
game/audio.cc | 44 +++++++++++++++++++++++++++++++++++---------
game/audio.hh | 7 +++++--
game/guitargraph.cc | 4 +++-
game/main.cc | 2 ++
game/screen_sing.cc | 8 ++++++--
game/screen_sing.hh | 1 +
6 files changed, 52 insertions(+), 14 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index ae4acfb..18824d8 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -5,6 +5,7 @@
#include <libda/fft.hpp> // For M_PI
#include <cmath>
#include <iostream>
+#include <boost/filesystem.hpp>
struct SampleStream {
SampleStream(boost::shared_ptr<FFmpeg> const& mpeg): m_mpeg(mpeg) {}
@@ -75,19 +76,39 @@ void Audio::play(Sample const& s, std::string const& volumeSetting) {
m_mixer.add(da::shared_ref(acc));
}
-void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos) {
+void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool preview, double fadeTime, double startPos, int speed) {
if (!isOpen()) return;
da::lock_holder l = m_mixer.lock();
fadeout(fadeTime);
boost::shared_ptr<da::chain> ch(new da::chain());
for(std::map<std::string,std::string>::const_iterator it = filenames.begin() ; it != filenames.end() ; ++it ) {
+ std::string f;
try {
- boost::shared_ptr<Stream> s(new Stream(it->second, m_rs.rate()));
+ f = it->second;
+ if (speed != 100) {
+ // instead of real-time time-stretching we use previously created files
+ // best effects have been achieved with SBSMS library
+ // as used by Audacity's Sliding Time Scale/ Pitch Shift plugin
+ std::string f2 = "-" + boost::lexical_cast<std::string>(speed) + ".ogg";
+ f.replace(f.find(".ogg"), 4, f2);
+ // std::cout << "loading time-stretched audio (" << f << ")" << std::endl;
+
+ if (!boost::filesystem::exists(f)) throw std::runtime_error("time-stretched file \"" + f +"\" not found");
+ }
+
+ boost::shared_ptr<Stream> s(new Stream(f, m_rs.rate()));
m_streams[it->first] = s;
ch->add(da::shared_ref(s));
s->seek(startPos);
} catch (std::runtime_error& e) {
- std::cerr << "Error loading " << it->second << " (" << e.what() << ")" << std::endl;
+ if (speed != 100) {
+ // in case time-stretching failed let's retry at normal speed
+ // TODO: we could also auto-create time-stretched files here
+ playMusic(filenames, preview, fadeTime, startPos, 100);
+ return;
+ }
+ // in case we are at normal speed we skip this file and try to continue
+ std::cerr << "Error loading " << f << " (" << e.what() << ")" << std::endl;
continue;
}
}
@@ -96,12 +117,14 @@ void Audio::playMusic(std::map<std::string,std::string> const& filenames, bool p
ch->add(boost::ref(m_volume));
m_mixer.fadein(da::shared_ref(ch), fadeTime, startPos);
if (!preview) pause(false);
+
+ m_speed = speed;
}
-void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos) {
+void Audio::playMusic(std::string const& filename, bool preview, double fadeTime, double startPos, int speed) {
std::map<std::string,std::string> tmp;
tmp["unidentified"] = filename;
- playMusic(tmp, preview, fadeTime, startPos);
+ playMusic(tmp, preview, fadeTime, startPos, speed);
}
void Audio::stopMusic() {
@@ -120,12 +143,13 @@ void Audio::fadeout(double fadeTime) {
double Audio::getPosition() const {
da::lock_holder l = m_mixer.lock();
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos();
+ // only the audio slows down; the game still uses original time base
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->pos() * m_speed/100.0;
}
double Audio::getLength() const {
da::lock_holder l = m_mixer.lock();
- return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration();
+ return m_streams.empty() ? getNaN() : m_streams.begin()->second->duration() * m_speed/100.0;
}
bool Audio::isPlaying() const {
@@ -133,14 +157,16 @@ bool Audio::isPlaying() const {
return m_streams.empty() ? false : !m_streams.begin()->second->eof();
}
-void Audio::seek(double offset) {
+void Audio::seek(double offset2) {
+ double offset = offset2 * 100.0/m_speed;
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(clamp(it->second->pos() + offset, 0.0, it->second->duration()));
pause(false);
}
-void Audio::seekPos(double pos) {
+void Audio::seekPos(double pos2) {
+ double pos = pos2 * 100.0/m_speed;
da::lock_holder l = m_mixer.lock();
for(std::map<std::string,boost::shared_ptr<Stream> >::iterator it = m_streams.begin() ; it != m_streams.end() ; ++it)
it->second->seek(pos);
diff --git a/game/audio.hh b/game/audio.hh
index e4f701f..d441cb1 100644
--- a/game/audio.hh
+++ b/game/audio.hh
@@ -94,9 +94,9 @@ class Audio {
* @param fadeTime time to fade
* @param startPos starting position
*/
- void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
+ void playMusic(std::string const& filename, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
/// plays a list of songs
- void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2);
+ void playMusic(std::map<std::string,std::string> const& filenames, bool preview = false, double fadeTime = 0.5, double startPos = -0.2, int speed = 100);
/// plays a sample
void play(Sample const& s, std::string const& volumeSetting);
/// get pause status
@@ -107,6 +107,8 @@ class Audio {
void fadeout(double time = 1.0);
/** Get the length of the currently playing song, in seconds. **/
double getLength() const;
+ /// return current speed
+ int getSpeed() {return m_speed;}
/**
* This methods seek forward in the stream (backwards if
* argument is negative), and continues playing.
@@ -137,5 +139,6 @@ class Audio {
std::string m_volumeSetting;
da::mixer m_mixer;
std::map<std::string,boost::shared_ptr<Stream> > m_streams;
+ int m_speed;
};
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0be7a41..0fdf6aa 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -185,7 +185,9 @@ bool GuitarGraph::difficulty(Difficulty level) {
/// Core engine
void GuitarGraph::engine() {
double time = m_audio.getPosition();
- time -= config["audio/controller_delay"].f();
+ // need to compensate for speed as well. When playing at half speed,
+ // 1 second from getPosition is actually two seconds in real time
+ time -= config["audio/controller_delay"].f() * m_audio.getSpeed()/100.0;
// Handle key markers
if (!m_drums) {
for (int i = 0; i < m_pads; ++i) {
diff --git a/game/main.cc b/game/main.cc
index 91aed77..03da057 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -145,6 +145,8 @@ void audioSetup(Capture& capture, Audio& audio) {
if (channels != 2) throw std::runtime_error("Only stereo playback is supported, error in pdev=" + *it);
try {
audio.open(devstr, rate, frames);
+ // when we get here, we have successfully opened a device. let's use it!
+ break;
} catch (std::exception const& e) {
std::cerr << "Playback device pdev=" << *it << " failed and will be ignored:\n " << e.what() << std::endl;
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index dd822f3..0b52e85 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -31,6 +31,7 @@ namespace {
void ScreenSing::enter() {
//m_practmode = true; // un-comment this line to play with practice mode. temporary, of course!
+ m_speed = 75; // 75% slow-down; falls back to 100% if time-stretch files are not found. temporary, of course!
ScreenManager* sm = ScreenManager::getSingletonPtr();
sm->flashMessage(_("Loading song..."), 0.0, 1.0, 0.5);
sm->drawFlashMessage(); sm->window().swap(); // Make loading message show
@@ -85,6 +86,7 @@ void ScreenSing::enter() {
theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_capture.analyzers();
m_layout_singer.reset(new LayoutSinger(m_song->vocals, m_database, theme));
+
// Load instrument and dance tracks
{
int type = 0; // 0 for dance, 1 for guitars, 2 for drums
@@ -108,7 +110,7 @@ void ScreenSing::enter() {
}
// Startup delay for instruments is longer than for singing only
double setup_delay = (m_instruments.empty() && m_dancers.empty() ? -1.0 : -8.0);
- m_audio.playMusic(m_song->music, false, 0.0, setup_delay);
+ m_audio.playMusic(m_song->music, false, 0.0, setup_delay, m_speed);
m_engine.reset(new Engine(m_audio, m_song->vocals, analyzers.begin(), analyzers.end(), m_database));
}
@@ -317,7 +319,9 @@ void ScreenSing::draw() {
// Get the time in the song
double length = m_audio.getLength();
double time = m_audio.getPosition();
- time -= config["audio/video_delay"].f();
+ // need to compensate for speed as well. When playing at half speed,
+ // 1 second from getPosition is actually two seconds in real time
+ time -= config["audio/video_delay"].f() * m_audio.getSpeed()/100.0;
double songPercent = clamp(time / length);
// Rendering starts
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index c743877..16cff8e 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -93,5 +93,6 @@ class ScreenSing: public Screen {
AnimValue m_quitTimer;
bool m_only_singers_alive;
bool m_practmode;
+ int m_speed; // speed in percent, 100 for normal, 50 for half
};
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:27
|
Module: performous Branch: joinmenu Commit: 107a4c07d8a03dffa603a6d38eed6476c83bd70c Author: Felix Bertram <fl...@be...> Date: Fri Jul 2 10:20:13 2010 -0700 Midi I/O does not compile under Fedora 13 libporttime does not exist on Fedora 13 --- cmake/Modules/FindPortMidi.cmake | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cmake/Modules/FindPortMidi.cmake b/cmake/Modules/FindPortMidi.cmake index f5126d8..38224a0 100644 --- a/cmake/Modules/FindPortMidi.cmake +++ b/cmake/Modules/FindPortMidi.cmake @@ -13,7 +13,7 @@ include(LibFindMacros) find_path(PortMidi_INCLUDE_DIR NAMES portmidi.h) find_library(PortMidi_LIBRARY NAMES portmidi) -find_library(PortTime_LIBRARY NAMES porttime) +find_library(PortTime_LIBRARY NAMES portmidi) set(PortMidi_PROCESS_INCLUDES PortMidi_INCLUDE_DIR) set(PortMidi_PROCESS_LIBS PortMidi_LIBRARY PortTime_LIBRARY) |
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:24
|
Module: performous
Branch: joinmenu
Commit: 2ea1b45f0368a74a30f8782d318598495823c1ba
Author: Tapio Vierros <tap...@gm...>
Date: Wed Jun 23 21:35:13 2010 +0300
Add a popup at the beginning of a dance stop.
---
game/dancegraph.cc | 16 ++++++++++++++--
game/dancegraph.hh | 1 +
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index cf9c556..5b19a65 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -78,7 +78,8 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_arrows_cursor(getThemePath("arrows_cursor.svg")),
m_arrows_hold(getThemePath("arrows_hold.svg")),
m_mine(getThemePath("mine.svg")),
- m_flow_direction(1)
+ m_flow_direction(1),
+ m_insideStop()
{
// Initialize some arrays
for(size_t i = 0; i < max_panels; i++) {
@@ -177,11 +178,22 @@ void DanceGraph::difficulty(DanceDifficulty level) {
void DanceGraph::engine() {
double time = m_audio.getPosition();
time -= config["audio/controller_delay"].f();
+ // Handle stops
+ bool outsideStop = true;
for (Song::Stops::const_iterator it = m_song.stops.begin(), end = m_song.stops.end(); it != end; ++it) {
if (it->first >= time) break;
- if (time < it->first + it->second) { time = it->first; break; } // Inside stop
+ if (time < it->first + it->second) { // Inside stop
+ time = it->first;
+ if (!m_insideStop) {
+ m_popups.push_back(Popup(_("STOP!"), glutil::Color(1.0f, 0.8f, 0.0), 2.0, m_popupText.get()));
+ m_insideStop = true;
+ }
+ outsideStop = false;
+ break;
+ }
time -= it->second;
}
+ if (outsideStop && m_insideStop) m_insideStop = false;
if (joining(time)) m_dead = 0; // Disable dead counting while joining
bool difficulty_changed = false;
// Handle all events
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index cfdd705..0eff7b7 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -80,5 +80,6 @@ class DanceGraph: public InstrumentGraph {
// Misc
int m_arrow_map[max_panels]; /// game mode dependant mapping of arrows' ordering at cursor
int m_flow_direction;
+ bool m_insideStop;
};
|
|
From: Tapio V. <aa...@us...> - 2010-07-07 17:07:21
|
Module: performous
Branch: joinmenu
Commit: b85c1ebb52719be4a71a2fb127a3ce7460161f63
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jun 22 23:03:56 2010 +0300
Add starpower button to Hama mapping.
---
game/joystick.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index e2a71a3..8c1cf66 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -121,7 +121,7 @@ int input::buttonFromSDL(input::detail::Type _type, unsigned int _sdl_button) {
{ 0, 1, 3, 2, 4,-1, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1 }, // Guitar Hero X-plorer guitar
{ 3, 0, 1, 2, 4, 5, -1, -1, 8, 9, -1, -1, -1, -1, -1, -1 }, // Rock Band guitar PS3
{ 0, 1, 3, 2, 4,-1, 8, 9, -1, -1, -1, -1, -1, -1, -1, -1 }, // Rock Band guitar XBOX360
- { 2, 1, 3, 4,-1, 0, -1, -1, 8, 9, -1, -1, -1, -1, -1, -1 }, // Hama Wireless Guitar Controller for PS2 with converter
+ { 2, 1, 3, 4, 5, 0, -1, -1, 8, 9, -1, -1, -1, -1, -1, -1 }, // Hama Wireless Guitar Controller for PS2 with converter
//K R Y B G O // for drums
{ 3, 4, 1, 2, 0, 4, -1, -1, 8, 9, -1, -1, -1, -1, -1, -1 }, // Guitar Hero drums
{ 3, 4, 1, 2, 0,-1, -1, -1, 8, 9, -1, -1, -1, -1, -1, -1 }, // Rock Band drums PS3
|