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-01-19 02:10:29
|
Module: performous
Branch: master
Commit: 3310d47a7a17c2cf556e1fde84386f7ba208782e
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jan 19 04:10:16 2010 +0200
Avoid rejoining between -1 and 0 seconds (no idea why that was possible, anyway).
---
game/dancegraph.cc | 2 +-
game/guitargraph.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 20ce556..baa27e1 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -205,7 +205,7 @@ void DanceGraph::engine() {
for (input::Event ev; m_input.tryPoll(ev);) {
m_dead = 0; // Keep alive
if (m_jointime != m_jointime) { // Handle joining
- m_jointime = time < -1.0 ? -1.0 : time + join_delay;
+ m_jointime = time < 0.0 ? -1.0 : time + join_delay;
break;
}
// Difficulty / mode selection
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index a65ebb3..9cc0163 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -201,7 +201,7 @@ void GuitarGraph::engine() {
// breaks to be usable with FoF songs.
if (dead() && m_input.isKeyboard() && ev.type == input::Event::PICK) continue;
m_dead = 0; // Keep alive
- if (m_jointime != m_jointime) m_jointime = time < -1.0 ? -1.0 : time + join_delay; // Handle joining
+ if (m_jointime != m_jointime) m_jointime = time < 0.0 ? -1.0 : time + join_delay; // Handle joining
// Handle Start/Select keypresses
if (ev.type == input::Event::PRESS && ev.button > input::STARPOWER_BUTTON) {
if (ev.button == 9) ev.button = input::STARPOWER_BUTTON; // Start works for GodMode
|
|
From: Tapio V. <aa...@us...> - 2010-01-18 22:30:21
|
Module: performous
Branch: master
Commit: e448ab311ae4e8656d073c231fdef298e91f0138
Author: Tapio Vierros <tap...@gm...>
Date: Tue Jan 19 00:26:11 2010 +0200
Better position for flash messages and separate theme font file.
---
game/screenmanager.cc | 4 +-
themes/default/message_text.svg | 76 +++++++++++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 2 deletions(-)
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index 0fa7d75..b45f1e9 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -5,12 +5,12 @@
template<> ScreenManager* Singleton<ScreenManager>::ms_Singleton = NULL;
-ScreenManager::ScreenManager(): m_finished(false), currentScreen(), m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("sing_timetxt.svg")) {
+ScreenManager::ScreenManager(): m_finished(false), currentScreen(), m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("message_text.svg")) {
m_timeToFade = 1.0f;
m_timeToShow = 3.0f;
m_messagePopup.setTarget(100.0);
- m_textMessage.dimensions.fixedWidth(0.5).right(0.5).screenTop(0.01);
+ m_textMessage.dimensions.middle().screenTop(0.05);
}
void ScreenManager::activateScreen(std::string const& name) {
diff --git a/themes/default/message_text.svg b/themes/default/message_text.svg
new file mode 100755
index 0000000..f7b6716
--- /dev/null
+++ b/themes/default/message_text.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Sodipodi ("http://www.sodipodi.com/") -->
+
+<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"
+ x="0"
+ y="0"
+ width="110"
+ height="20"
+ id="svg559"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="message_text.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2522">
+ <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="perspective8" />
+ </defs>
+ <metadata
+ id="metadata35">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:window-height="854"
+ inkscape:window-width="1440"
+ 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"
+ inkscape:zoom="3.5638182"
+ inkscape:cx="60.101374"
+ inkscape:cy="22.158164"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:current-layer="svg559"
+ showgrid="false"
+ inkscape:window-maximized="1" />
+ <text
+ x="0.21655023"
+ y="13.585703"
+ style="font-size:22px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.9659524;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline;font-family:Arial Black"
+ id="text10203"
+ xml:space="preserve"
+ sodipodi:linespacing="125%"
+ transform="scale(1.0082228,0.99184427)"><tspan
+ x="0.21655023"
+ y="13.585703"
+ id="tspan10205"
+ style="font-size:22px;text-align:start;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke-width:0.9659524">message</tspan></text>
+</svg>
|
|
From: Tapio V. <aa...@us...> - 2010-01-18 21:41:06
|
Module: performous
Branch: master
Commit: f344b0b2b7aecc21f0ef6798a5cb70e3b5b30e8d
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 23:40:22 2010 +0200
Add keyboard testing to --jstest.
---
game/main.cc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 6a0d491..4843252 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -212,6 +212,8 @@ void jstestLoop() {
while(SDL_PollEvent(&e) == 1) {
if (e.type == SDL_QUIT || (e.type == SDL_KEYDOWN && e.key.keysym.sym == SDLK_ESCAPE)) {
return;
+ } else if (e.type == SDL_KEYDOWN) {
+ std::cout << "Keyboard key: " << int(e.key.keysym.sym) << ", mod: " << int(e.key.keysym.mod) << std::endl;
} else if (e.type == SDL_JOYBUTTONDOWN) {
std::cout << "JoyID: " << int(e.jbutton.which) << ", button: " << int(e.jbutton.button) << ", state: " << int(e.jbutton.state) << std::endl;
} else if (e.type == SDL_JOYAXISMOTION) {
|
|
From: Tapio V. <aa...@us...> - 2010-01-18 17:50:59
|
Module: performous
Branch: master
Commit: 3f2c80c976774f6cf9c65437d1a85b8c60021426
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 19:50:18 2010 +0200
Add "flash" messages to singing screen.
---
game/screen_sing.cc | 26 ++++++++++++++++----------
1 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index e4220a7..f6269e5 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -20,6 +20,12 @@
namespace {
static const double QUIT_TIMEOUT = 20.0; // Return to songs screen after 20 seconds in score screen
+
+ /// Add a flash message about the state of a config item
+ void dispInFlash(ConfigItem& ci) {
+ ScreenManager* sm = ScreenManager::getSingletonPtr();
+ sm->FlashMessage(ci.getShortDesc() + ": " + ci.getValue());
+ }
}
void ScreenSing::enter() {
@@ -211,22 +217,22 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
}
// Volume control
- if (nav == input::VOLUME_UP) ++config["audio/music_volume"];
- if (nav == input::VOLUME_DOWN) --config["audio/music_volume"];
+ if (nav == input::VOLUME_UP) dispInFlash(++config["audio/music_volume"]);
+ if (nav == input::VOLUME_DOWN) dispInFlash(--config["audio/music_volume"]);
}
// Ctrl combinations that can be used while performing (not when score dialog is displayed)
if (event.type == SDL_KEYDOWN && (event.key.keysym.mod & KMOD_CTRL) && !m_score_window.get()) {
if (key == SDLK_s) m_audio.toggleSynth(m_song->notes);
if (key == SDLK_v) m_audio.streamFade("vocals", event.key.keysym.mod & KMOD_SHIFT ? 1.0 : 0.0);
- if (key == SDLK_k) ++config["game/karaoke_mode"]; // Toggle karaoke mode
- if (key == SDLK_w) ++config["game/pitch"]; // Toggle pitch wave
+ if (key == SDLK_k) dispInFlash(++config["game/karaoke_mode"]); // Toggle karaoke mode
+ if (key == SDLK_w) dispInFlash(++config["game/pitch"]); // Toggle pitch wave
// Latency settings
- if (key == SDLK_F1) --config["audio/video_delay"];
- if (key == SDLK_F2) ++config["audio/video_delay"];
- if (key == SDLK_F3) --config["audio/round-trip"];
- if (key == SDLK_F4) ++config["audio/round-trip"];
- if (key == SDLK_F5) --config["audio/controller_delay"];
- if (key == SDLK_F6) ++config["audio/controller_delay"];
+ if (key == SDLK_F1) dispInFlash(--config["audio/video_delay"]);
+ if (key == SDLK_F2) dispInFlash(++config["audio/video_delay"]);
+ if (key == SDLK_F3) dispInFlash(--config["audio/round-trip"]);
+ if (key == SDLK_F4) dispInFlash(++config["audio/round-trip"]);
+ 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; }
|
|
From: Tapio V. <aa...@us...> - 2010-01-18 14:59:45
|
Module: performous
Branch: master
Commit: 71583aa4151dca59daa95cf2dca1720588609982
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 16:58:30 2010 +0200
Move screenshot flash message to a place where it actually tells it the shot succeeded.
---
game/main.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 6e56350..6a0d491 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -64,7 +64,6 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
}
if (keypressed == SDLK_PRINT || keypressed == SDLK_F12) {
g_take_screenshot = true;
- sm.FlashMessage(_("Screenshot taken!"));
continue;
}
if (keypressed == SDLK_F4 && modifier & KMOD_ALT) {
@@ -161,8 +160,10 @@ void mainLoop(std::string const& songlist) {
fs::path filename;
try {
window.screenshot();
+ sm.FlashMessage(_("Screenshot taken!"));
} catch (std::exception& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
+ sm.FlashMessage(_("Screenshot failed!"));
}
g_take_screenshot = false;
}
|
|
From: Tapio V. <aa...@us...> - 2010-01-18 14:38:25
|
Module: performous
Branch: master
Commit: 169142a00cc5d9428a835c4fff7d35a270440c41
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 16:37:10 2010 +0200
Applied lordheavy's patch to filter out unwanted axis events in jstest.
---
game/main.cc | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index e19b5d6..6e56350 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -205,6 +205,7 @@ void jstestLoop() {
Window window(config["graphic/window_width"].i(), config["graphic/window_height"].i(), false);
// Main loop
boost::xtime time = now();
+ int oldjoy = -1, oldaxis = -1, oldvalue = -1;
while (true) {
SDL_Event e;
while(SDL_PollEvent(&e) == 1) {
@@ -213,7 +214,12 @@ void jstestLoop() {
} else if (e.type == SDL_JOYBUTTONDOWN) {
std::cout << "JoyID: " << int(e.jbutton.which) << ", button: " << int(e.jbutton.button) << ", state: " << int(e.jbutton.state) << std::endl;
} else if (e.type == SDL_JOYAXISMOTION) {
- std::cout << "JoyID: " << int(e.jaxis.which) << ", axis: " << int(e.jaxis.axis) << ", value: " << int(e.jaxis.value) << std::endl;
+ if ((oldjoy != int(e.jaxis.which)) || (oldaxis != int(e.jaxis.axis)) || (oldvalue != int(e.jaxis.value))) {
+ std::cout << "JoyID: " << int(e.jaxis.which) << ", axis: " << int(e.jaxis.axis) << ", value: " << int(e.jaxis.value) << std::endl;
+ oldjoy = int(e.jaxis.which);
+ oldaxis = int(e.jaxis.axis);
+ oldvalue = int(e.jaxis.value);
+ }
} else if (e.type == SDL_JOYHATMOTION) {
std::cout << "JoyID: " << int(e.jhat.which) << ", hat: " << int(e.jhat.hat) << ", value: " << int(e.jhat.value) << std::endl;
}
|
|
From: Stefano A. <xa...@us...> - 2010-01-18 11:55:24
|
Module: performous
Branch: master
Commit: 8070d24b199338279710bfc23100c78fd70f7845
Author: Xaldyz <xa...@us...>
Date: Mon Jan 18 12:55:15 2010 +0100
Added support for FlashMessage. Example to how to use it in "take screenshot" in main.cc. Alpha version
---
game/main.cc | 2 +
game/screen.hh | 20 +++++++++++++++
game/screenmanager.cc | 63 ++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 84 insertions(+), 1 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 81c20ae..e19b5d6 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -64,6 +64,7 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
}
if (keypressed == SDLK_PRINT || keypressed == SDLK_F12) {
g_take_screenshot = true;
+ sm.FlashMessage(_("Screenshot taken!"));
continue;
}
if (keypressed == SDLK_F4 && modifier & KMOD_ALT) {
@@ -170,6 +171,7 @@ void mainLoop(std::string const& songlist) {
// Draw
window.blank();
sm.getCurrentScreen()->draw();
+ sm.FlashMessages();
// Display (and wait until next frame)
window.swap();
if (config["graphic/fps"].b()) {
diff --git a/game/screen.hh b/game/screen.hh
index d9f3939..118d309 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -1,6 +1,8 @@
#pragma once
#include "singleton.hh"
+#include "animvalue.hh"
+#include "opengl_text.hh"
#include <boost/ptr_container/ptr_map.hpp>
#include <SDL.h>
#include <string>
@@ -44,6 +46,19 @@ class ScreenManager: public Singleton <ScreenManager> {
Screen* getCurrentScreen() { return currentScreen; };
/// returns pointer to Screen for given name
Screen* getScreen(std::string const& name);
+
+ /// Get time to fade in/out the message
+ float getFadeTime();
+ /// Get time the message have to been showned
+ float getShowTime();
+ /// Set time to fade in/out the message
+ bool setFadeTime(float fadeTime);
+ /// Set time the message have to been showned
+ bool setShowTime(float showTime);
+ /// Set a messag to flash in current screen
+ void FlashMessage(std::string const& name);
+ /// Flash messages in current screen
+ void FlashMessages();
/// sets finished to true
void finished() { m_finished=true; };
@@ -52,9 +67,14 @@ class ScreenManager: public Singleton <ScreenManager> {
private:
bool m_finished;
+ float m_timeToFade;
+ float m_timeToShow;
typedef boost::ptr_map<std::string, Screen> screenmap_t;
screenmap_t screens;
Screen* newScreen;
Screen* currentScreen;
+ AnimValue m_messagePopup;
+ SvgTxtTheme m_textMessage;
+ std::string m_message;
};
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index b007e8f..0fa7d75 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -1,10 +1,17 @@
#include "screen.hh"
+#include "fs.hh"
#include <stdexcept>
template<> ScreenManager* Singleton<ScreenManager>::ms_Singleton = NULL;
-ScreenManager::ScreenManager(): m_finished(false), currentScreen() {}
+ScreenManager::ScreenManager(): m_finished(false), currentScreen(), m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("sing_timetxt.svg")) {
+ m_timeToFade = 1.0f;
+ m_timeToShow = 3.0f;
+
+ m_messagePopup.setTarget(100.0);
+ m_textMessage.dimensions.fixedWidth(0.5).right(0.5).screenTop(0.01);
+}
void ScreenManager::activateScreen(std::string const& name) {
newScreen = getScreen(name);
@@ -27,3 +34,57 @@ Screen* ScreenManager::getScreen(std::string const& name) {
}
}
+float ScreenManager::getFadeTime(){ return m_timeToFade; }
+float ScreenManager::getShowTime(){ return m_timeToFade; }
+
+bool ScreenManager::setFadeTime(float fadeTime){
+ if (fadeTime * 2 > m_timeToShow){ //fade in + fade out
+ m_timeToFade = m_timeToShow / 2;
+ return false;
+ } else {
+ m_timeToFade = fadeTime;
+ return true;
+ }
+}
+
+bool ScreenManager::setShowTime(float showTime){
+ if (showTime < m_timeToFade * 2){
+ m_timeToShow = m_timeToFade / 2;
+ return false;
+ } else {
+ m_timeToShow = showTime;
+ return true;
+ }
+}
+
+void ScreenManager::FlashMessages() {
+ double time = m_messagePopup.get();
+ if (time > 0.0){
+ bool haveToFadeIn = time < (m_timeToFade);
+ bool haveToFadeOut = time > (m_messagePopup.getTarget() - m_timeToFade);
+ bool haveToStop = time > (m_messagePopup.getTarget() - 0.001);
+ float fadeValue = 1.0f;
+ if (haveToFadeOut){
+ fadeValue = float((m_messagePopup.getTarget() - time) / m_timeToFade);
+ glColor4f(1.0f, 1.0f, 1.0f, (fadeValue));
+
+ if(haveToStop){
+ m_messagePopup.setTarget(0.0, true);
+ }
+ }else if (haveToFadeIn){
+ fadeValue = float(time / m_timeToFade);
+
+ glColor4f(1.0f, 1.0f, 1.0f, fadeValue);
+ }
+
+ m_textMessage.draw(m_message, fadeValue);
+
+ if (haveToFadeIn || haveToFadeOut) glColor3f(1.0f, 1.0f, 1.0f);
+ }
+}
+
+void ScreenManager::FlashMessage(std::string const& message) {
+ m_messagePopup.setTarget(m_timeToShow);
+ m_messagePopup.setValue(0);
+ m_message = message;
+}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 08:00:00
|
Module: performous
Branch: master
Commit: 35a3687491df1fbece132cb87c3ad2a9655af9ef
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 09:59:43 2010 +0200
Slightly improved usability for that hack
---
game/screen_songs.cc | 28 +++++++++++++++++-----------
1 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 1effacc..838586e 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -74,8 +74,8 @@ void ScreenSongs::manageEvent(SDL_Event event) {
else manageSharedKey(nav);
return;
} else if (nav == input::CANCEL) {
- if (m_search.text.empty()) sm->activateScreen("Intro");
- else { m_search.text.clear(); m_songs.setFilter(m_search.text); }
+ if (m_search.text.empty() && m_songs.getTypeFilter() == 0) sm->activateScreen("Intro");
+ else { m_search.text.clear(); m_songs.setFilter(m_search.text); m_songs.setTypeFilter(0); }
}
// The rest are only available when there are songs available
else if (m_songs.empty()) return;
@@ -93,6 +93,10 @@ void ScreenSongs::manageEvent(SDL_Event event) {
SDLMod mod = event.key.keysym.mod;
if (key == SDLK_r && mod & KMOD_CTRL) { m_songs.reload(); m_songs.setFilter(m_search.text); }
if (!m_jukebox && m_search.process(keysym)) m_songs.setFilter(m_search.text);
+ if (key == SDLK_F5) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 8); // Vocals
+ if (key == SDLK_F6) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 4); // Guitars
+ if (key == SDLK_F7) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 2); // Drums
+ if (key == SDLK_F8) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 1); // Dance
// The rest are only available when there are songs available
else if (m_songs.empty()) return;
else if (!m_jukebox && key == SDLK_F4) m_jukebox = true;
@@ -104,10 +108,6 @@ void ScreenSongs::manageEvent(SDL_Event event) {
ss->setSong(m_songs.currentPtr());
sm->activateScreen("Hiscore");
}
- else if (key == SDLK_F5) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 8); // Vocals
- else if (key == SDLK_F6) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 4); // Guitars
- else if (key == SDLK_F7) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 2); // Drums
- else if (key == SDLK_F8) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 1); // Dance
}
}
@@ -261,12 +261,14 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
UseTexture tex(*m_instrumentList);
double x;
float xincr = 0.2f;
+ unsigned char typeFilter = m_songs.getTypeFilter();
{
// vocals
float a = alpha * (song.hasVocals() ? 1.00 : 0.25);
+ float m = !(typeFilter & 8);
bool karaoke = (song.music.find("vocals") != song.music.end());
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0f, 1.0f, karaoke ? 0.25f : 1.0f, a);
+ glColor4f(m * 1.0f, 1.0f, m * (karaoke ? 0.25f : 1.0f), a);
x = dim.x1()+0.00*(dim.x2()-dim.x1());
glTexCoord2f(getIconTex(1), 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(getIconTex(1), 1.0f); glVertex2f(x, dim.y2());
@@ -277,6 +279,7 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
{
// guitars
float a = alpha;
+ float m = !(typeFilter & 4);
int guitarCount = 0;
if (isTrackInside(song.track_map,"guitar")) guitarCount++;
if (isTrackInside(song.track_map,"coop guitar")) guitarCount++;
@@ -284,7 +287,7 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
if (guitarCount == 0) { guitarCount = 1; a *= 0.25f; }
for (int i = guitarCount-1; i >= 0; i--) {
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0f, 1.0f, 1.0f, a);
+ glColor4f(m * 1.0f, 1.0f, m * 1.0f, a);
x = dim.x1()+(xincr+i*0.04)*(dim.x2()-dim.x1());
glTexCoord2f(getIconTex(2), 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(getIconTex(2), 1.0f); glVertex2f(x, dim.y2());
@@ -296,8 +299,9 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
{
// bass
float a = alpha * (isTrackInside(song.track_map,"bass") ? 1.00f : 0.25f);
+ float m = !(typeFilter & 4);
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0f, 1.0f, 1.0f, a);
+ glColor4f(m * 1.0f, 1.0f, m * 1.0f, a);
x = dim.x1()+2*xincr*(dim.x2()-dim.x1());
glTexCoord2f(getIconTex(3), 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(getIconTex(3), 1.0f); glVertex2f(x, dim.y2());
@@ -308,8 +312,9 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
{
// drums
float a = alpha * (song.hasDrums() ? 1.00f : 0.25f);
+ float m = !(typeFilter & 2);
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0f, 1.0f, 1.0f, a);
+ glColor4f(m * 1.0f, 1.0f, m * 1.0f, a);
x = dim.x1()+3*xincr*(dim.x2()-dim.x1());
glTexCoord2f(getIconTex(4), 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(getIconTex(4), 1.0f); glVertex2f(x, dim.y2());
@@ -320,8 +325,9 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
{
// dancing
float a = alpha * (song.hasDance() ? 1.00f : 0.25f);
+ float m = !(typeFilter & 1);
glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0f, 1.0f, 1.0f, a);
+ glColor4f(m * 1.0f, 1.0f, m * 1.0f, a);
x = dim.x1()+4*xincr*(dim.x2()-dim.x1());
glTexCoord2f(getIconTex(5), 0.0f); glVertex2f(x, dim.y1());
glTexCoord2f(getIconTex(5), 1.0f); glVertex2f(x, dim.y2());
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 07:48:22
|
Module: performous
Branch: master
Commit: fd3f1695d2ac2cd10888e1cba8c72b4657a868aa
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 09:48:13 2010 +0200
A quick hack to allow filtering by instrument type (keys F5-F8 in song selector)
---
game/screen_songs.cc | 6 +++++-
game/song.hh | 1 +
game/songs.cc | 15 +++++++++++++--
game/songs.hh | 5 +++++
4 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 901c313..1effacc 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -104,6 +104,10 @@ void ScreenSongs::manageEvent(SDL_Event event) {
ss->setSong(m_songs.currentPtr());
sm->activateScreen("Hiscore");
}
+ else if (key == SDLK_F5) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 8); // Vocals
+ else if (key == SDLK_F6) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 4); // Guitars
+ else if (key == SDLK_F7) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 2); // Drums
+ else if (key == SDLK_F8) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 1); // Dance
}
}
@@ -259,7 +263,7 @@ void ScreenSongs::drawInstruments(Song const& song, Dimensions const& dim, float
float xincr = 0.2f;
{
// vocals
- float a = alpha * (!song.notes.empty() ? 1.00 : 0.25);
+ float a = alpha * (song.hasVocals() ? 1.00 : 0.25);
bool karaoke = (song.music.find("vocals") != song.music.end());
glutil::Begin block(GL_TRIANGLE_STRIP);
glColor4f(1.0f, 1.0f, karaoke ? 0.25f : 1.0f, a);
diff --git a/game/song.hh b/game/song.hh
index 6d817c9..f99a778 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -46,6 +46,7 @@ class Song: boost::noncopyable {
bool hasDance() const { return !danceTracks.empty(); }
bool hasDrums() const { return track_map.find("drums") != track_map.end(); }
bool hasGuitars() const { return track_map.size() - hasDrums(); }
+ bool hasVocals() const { return !notes.empty(); }
int noteMin, ///< lowest note
noteMax; ///< highest note
std::string path; ///< path of songfile
diff --git a/game/songs.cc b/game/songs.cc
index eb1ced2..99fece7 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -16,7 +16,7 @@
#include <stdexcept>
#include <cstdlib>
-Songs::Songs(Database & database, std::string const& songlist): m_songlist(songlist), math_cover(), m_database(database), m_order(), m_dirty(false), m_loading(false) {
+Songs::Songs(Database & database, std::string const& songlist): m_songlist(songlist), math_cover(), m_typeFilter(), m_database(database), m_order(), m_dirty(false), m_loading(false) {
reload();
}
@@ -120,6 +120,12 @@ void Songs::setFilter(std::string const& val) {
filter_internal();
}
+void Songs::setTypeFilter(unsigned char filter) {
+ if (m_typeFilter == filter) return;
+ m_typeFilter = filter;
+ filter_internal();
+}
+
void Songs::filter_internal() {
boost::mutex::scoped_lock l(m_mutex);
// Print messages when loading has finished
@@ -132,7 +138,12 @@ void Songs::filter_internal() {
try {
SongVector filtered;
for (SongVector::const_iterator it = m_songs.begin(); it != m_songs.end(); ++it) {
- if (regex_search(it->get()->strFull(), boost::regex(m_filter, boost::regex_constants::icase))) filtered.push_back(*it);
+ Song& s = **it;
+ if ((m_typeFilter & 1) && !s.hasDance()) continue;
+ if ((m_typeFilter & 2) && !s.hasDrums()) continue;
+ if ((m_typeFilter & 4) && !s.hasGuitars()) continue;
+ if ((m_typeFilter & 8) && !s.hasVocals()) continue;
+ if (regex_search(s.strFull(), boost::regex(m_filter, boost::regex_constants::icase))) filtered.push_back(*it);
}
m_filtered.swap(filtered);
} catch (...) {
diff --git a/game/songs.hh b/game/songs.hh
index c49deac..d403139 100644
--- a/game/songs.hh
+++ b/game/songs.hh
@@ -53,6 +53,10 @@ class Songs: boost::noncopyable {
Song const& current() const { return *m_filtered[math_cover.getTarget()]; }
/// filters songlist by regular expression
void setFilter(std::string const& regex);
+ /// filters songlist by instrument type (bitmask)
+ void setTypeFilter(unsigned char filter);
+ /// get current type filter (bitmask)
+ unsigned char getTypeFilter() const { return m_typeFilter; }
/// sort descending
std::string sortDesc() const;
/// changes sorting
@@ -67,6 +71,7 @@ class Songs: boost::noncopyable {
SongVector m_songs, m_filtered;
AnimAcceleration math_cover;
std::string m_filter;
+ unsigned char m_typeFilter;
Database & m_database;
int m_order;
void dumpSongs_internal() const;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 07:26:56
|
Module: performous
Branch: master
Commit: 78a6d7ee6a563cba2e4a9339709e7a440d63b94d
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 09:26:37 2010 +0200
Proper GLEW initialization
---
game/video_driver.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 5eb3625..52306e0 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -34,6 +34,7 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
resize();
SDL_ShowCursor(SDL_DISABLE);
SDL_EnableUNICODE(SDL_ENABLE);
+ if (glewInit() != GLEW_OK) throw std::runtime_error("Initializing GLEW failed (is your OpenGL broken?)");
input::SDL::init();
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 03:30:28
|
Module: performous
Branch: master
Commit: d26cf5062b29ba14cd32ffc4d4dc95fe284438f7
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 05:30:15 2010 +0200
Fix screen switching
---
docs/TODO.txt | 1 -
game/main.cc | 5 ++++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index c29d0ee..02612ab 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -59,5 +59,4 @@ SS Ripper:
Bugs:
- Segfault when browsing songs in song browser while loading (segfaults before loading finishes), quite rare
-- Players screen displays shit
diff --git a/game/main.cc b/game/main.cc
index 26ff4e1..81c20ae 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -167,9 +167,10 @@ void mainLoop(std::string const& songlist) {
}
sm.updateScreen(); // exit/enter, any exception is fatal error
try {
- checkEvents_SDL(sm, window);
+ // Draw
window.blank();
sm.getCurrentScreen()->draw();
+ // Display (and wait until next frame)
window.swap();
if (config["graphic/fps"].b()) {
++frames;
@@ -183,6 +184,8 @@ void mainLoop(std::string const& songlist) {
time = now();
frames = 0;
}
+ // Process events for the next frame
+ checkEvents_SDL(sm, window);
} catch (std::runtime_error& e) {
std::cerr << "ERROR: " << e.what() << std::endl;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 03:13:30
|
Module: performous
Branch: master
Commit: a40daaf21a3c42669bf82663a6abe9b91227ed68
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 05:13:18 2010 +0200
Better feedback for hold notes
---
docs/TODO.txt | 1 +
game/dancegraph.cc | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 02612ab..c29d0ee 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -59,4 +59,5 @@ SS Ripper:
Bugs:
- Segfault when browsing songs in song browser while loading (segfaults before loading finishes), quite rare
+- Players screen displays shit
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index c3b83e5..20ce556 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -413,7 +413,7 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
glutil::Color c(1.0f, 1.0f, 1.0f);
// Did we hit it?
- if (note.isHit && std::abs(tEnd) < maxTolerance && note.hitAnim.getTarget() == 0) {
+ if (note.isHit && (note.releaseTime > 0.0 || std::abs(tEnd) < maxTolerance) && note.hitAnim.getTarget() == 0.0) {
if (mine) note.hitAnim.setRate(1.0);
note.hitAnim.setTarget(1.0, false);
}
@@ -465,7 +465,7 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
text = "HOLD";
glow = 1.0;
} else if (glow > 0.0) { // Released already, display rank
- text = getRank(note.error);
+ text = note.score ? getRank(note.error) : "FAIL!";
}
if (!text.empty()) {
glColor3f(1.0f, 1.0f, 1.0f);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 03:03:22
|
Module: performous Branch: master Commit: 879469efc1e54ed0ffbe58abf0cec7b8ecc734a5 Author: Lasse Karkkainen <tro...@tr...> Date: Mon Jan 18 05:01:50 2010 +0200 Guitargraph and dancegraph changes: - m_jointime now tells the time when the mode selection ends and it is NaN before joining - removed all debug printout - 3d notes no longer fallback to 2d notes if loading fails --- game/dancegraph.cc | 27 +++++++-------------------- game/guitargraph.cc | 28 +++++++--------------------- 2 files changed, 14 insertions(+), 41 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 03:03:20
|
Module: performous
Branch: master
Commit: a4d15efb2ae8684401053c41430873c4dad2987d
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 03:03:13 2010 +0200
Only display instruments for the current song.
---
game/screen_songs.cc | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index ccd3cd2..901c313 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -219,11 +219,8 @@ void ScreenSongs::draw() {
double diff = (i == 0 ? (0.5 - fabs(shift)) * 0.07 : 0.0);
double y = 0.27 + 0.5 * diff;
s.dimensions.middle(-0.2 + 0.17 * (i - shift)).bottom(y - 0.2 * diff).fitInside(0.14 + diff, 0.14 + diff);
- Dimensions dim = s.dimensions;
- dim.ar(m_instrumentList->ar());
- // Draw the cover and the instruments normally
+ // Draw the cover normally
s.draw();
- drawInstruments(song_display, dim);
// Draw the reflection
{
glutil::PushMatrix m;
@@ -231,10 +228,8 @@ void ScreenSongs::draw() {
glScalef(1.0f, -1.0f, 1.0f);
glColor4f(1.0f, 1.0f, 1.0f, 0.4f);
s.draw();
- drawInstruments(song_display, dim, 0.4f);
+ glColor3f(1.0f, 1.0f, 1.0f);
}
- //s.dimensions.top(y + 0.2 * diff); s.tex = TexCoords(0, 1, 1, 0); glColor4f(1.0, 1.0, 1.0, 0.4); s.draw();
- //s.tex = TexCoords(); glColor4f(1.0, 1.0, 1.0, 1.0); // Restore default attributes
}
}
updateMultimedia(song, info);
@@ -245,6 +240,7 @@ void ScreenSongs::draw() {
theme->song.draw(oss_song.str());
theme->order.draw(oss_order.str());
theme->hiscore.draw(oss_hiscore.str());
+ if (!m_songs.empty()) drawInstruments(m_songs.current(), Dimensions(m_instrumentList->ar()).fixedHeight(0.03).center(-0.04));
}
stopMultimedia(info);
if (m_jukebox) {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-18 00:50:16
|
Module: performous Branch: master Commit: 7b0e21f30deda808cb3ef26e7f6a14b8a8f4a9ce Author: Lasse Karkkainen <tro...@tr...> Date: Mon Jan 18 02:47:51 2010 +0200 Moved instrument type indicators to bottom of label image. Surface now allows setting AR after construction too. --- game/notes.hh | 5 +- game/screen_songs.cc | 173 ++++++++++++++++++++++++++------------------------ game/screen_songs.hh | 5 +- game/surface.hh | 2 + 4 files changed, 97 insertions(+), 88 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2010-01-18 00:00:36
|
Module: performous
Branch: master
Commit: 5e911c84aef3c20b4c139ac803c49fa8b5bfcceb
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Jan 18 01:00:19 2010 +0100
Fixed some whitespaces
---
game/3dobject.cc | 6 +++---
game/3dobject.hh | 2 +-
game/backgrounds.cc | 2 +-
game/backgrounds.hh | 2 +-
game/configuration.cc | 2 +-
game/dancegraph.cc | 18 +++++++++---------
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index 0ce4f3d..9379613 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -40,13 +40,13 @@ void Object3d::loadWavefrontObj(std::string filepath, float scale) {
std::istringstream srow(row);
float x,y,z;
std::string tempst;
- if (row.substr(0,2) == "v ") { // Vertices
+ if (row.substr(0,2) == "v ") { // Vertices
srow >> tempst >> x >> y >> z;
m_vertices.push_back(Vertex(x*scale,y*scale,z*scale));
- } else if (row.substr(0,2) == "vt") { // Texture Coordinates
+ } else if (row.substr(0,2) == "vt") { // Texture Coordinates
srow >> tempst >> x >> y;
m_texcoords.push_back(TexCoord(x,y));
- } else if (row.substr(0,2) == "vn") { // Normals
+ } else if (row.substr(0,2) == "vn") { // Normals
srow >> tempst >> x >> y >> z;
double sum = std::abs(x)+std::abs(y)+std::abs(z);
if (sum == 0) throw std::runtime_error("Object "+filepath+" has invalid normal(s).");
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 8761ca6..11f3840 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -17,7 +17,7 @@
struct Vertex {
Vertex(float x = 0, float y = 0, float z = 0): x(x), y(y), z(z) {}
float x;
- float y;
+ float y;
float z;
};
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 4aaf895..bf99af4 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -37,7 +37,7 @@ void Backgrounds::reload_internal() {
if (diff > 0 && m_loading) std::cout << diff << " backgrounds loaded" << std::endl;
}
m_loading = false;
- {
+ {
boost::mutex::scoped_lock l(m_mutex);
random_shuffle(m_bgs.begin(), m_bgs.end());
m_dirty = false;
diff --git a/game/backgrounds.hh b/game/backgrounds.hh
index b687dc4..aa99bab 100644
--- a/game/backgrounds.hh
+++ b/game/backgrounds.hh
@@ -32,7 +32,7 @@ class Backgrounds: boost::noncopyable {
int empty() const { return m_bgs.empty(); };
/// returns random background
std::string getRandom();
-
+
private:
typedef std::vector<std::string> BGVector;
BGVector m_bgs;
diff --git a/game/configuration.cc b/game/configuration.cc
index 26d41b6..194c25f 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -72,7 +72,7 @@ namespace {
fmter % boost::io::group(std::setprecision(precision), double(m) * boost::get<T>(value));
return fmter.str();
}
-
+
fs::path origin; // The primary shared data folder
}
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 3969dae..a9d3266 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -61,7 +61,7 @@ namespace {
return "Way off!";
}
}
-
+
struct lessEnd {
bool operator()(const DanceNote& left, const DanceNote& right) {
return left.note.end < right.note.end;
@@ -105,10 +105,10 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_pressed_anim[i] = AnimValue(0.0, 4.0);
m_arrow_map[i] = -1;
}
-
+
if(m_song.danceTracks.empty())
throw std::runtime_error("Could not find any dance tracks.");
-
+
gameMode(0);
}
@@ -148,7 +148,7 @@ void DanceGraph::gameMode(int direction) {
else if (gm == "ez2-real") { m_pads = 7; std::copy(mapping7, mapping7+max_panels, m_arrow_map); }
else if (gm == "para-single") { m_pads = 5; std::copy(mapping5, mapping5+max_panels, m_arrow_map); }
else throw std::runtime_error("Unknown track " + gm);
-
+
difficultyDelta(0); // Construct new notes
}
@@ -371,7 +371,7 @@ void DanceGraph::draw(double time) {
// Draw the "neck" graph (beat lines)
drawBeats(time);
-
+
// Arrows on cursor
glColor3f(1.0f, 1.0f, 1.0f);
for (int arrow_i = 0; arrow_i < m_pads; ++arrow_i) {
@@ -381,7 +381,7 @@ void DanceGraph::draw(double time) {
float s = (5.0 - l) / 5.0;
drawArrow(arrow_i, m_arrows_cursor, x, y, s);
}
-
+
// Draw the notes
for (DanceNotes::iterator it = m_notes.begin(); it != m_notes.end(); ++it) {
if (it->note.end - time < past) continue;
@@ -424,14 +424,14 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
float yBeg = time2y(tBeg);
float yEnd = time2y(tEnd);
glutil::Color c(1.0f, 1.0f, 1.0f);
-
+
// Did we hit it?
if (note.isHit && std::abs(tEnd) < maxTolerance && note.hitAnim.getTarget() == 0) {
if (mine) note.hitAnim.setRate(1.0);
note.hitAnim.setTarget(1.0, false);
}
double glow = note.hitAnim.get();
-
+
if (yEnd - yBeg > arrowSize) {
// Draw holds
glColor4fv(c);
@@ -502,7 +502,7 @@ void DanceGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
m_text.dimensions.screenBottom(-0.35).middle(0.32 * dimensions.w() + offsetX);
m_text.draw(boost::lexical_cast<std::string>(unsigned(getScore())));
m_text.dimensions.screenBottom(-0.32).middle(0.32 * dimensions.w() + offsetX);
- m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
}
// Draw streak pop-up for long streak intervals
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 23:39:42
|
Module: performous
Branch: master
Commit: fefc8fe3601ed4db26efe69b8b208ba7afefd133
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 01:39:07 2010 +0200
Update TODO with current plans and remove bugs that have disappeared.
---
docs/TODO.txt | 28 ++++++++--------------------
1 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/docs/TODO.txt b/docs/TODO.txt
index acb923e..02612ab 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -1,25 +1,22 @@
This file lists long-time goals that are not fixable quickly. Issues that are easily
fixable should not be recorded here, but should rather be fixed in the code.
+
Structural:
-- LibDA as a separate project
- * Also playback and Vorbis + MP3 decoding
- * Mixer and samplerate conversion inside
-- Get rid of ScreenManager in favor of recursive approach?
-- Switch to Clanlib or SFML?
+- PortAudio as the only audio backend (instead of libda plugin system) [WIP]
+- Rename ScreenManager to Game and put globally used resources into it
- Switch to GStreamer? (both the ripper and the game)
Big features:
- Add compose screen (using features discussed on mailing list)
-- Multiplayer duet (needs XML or MIDI song format)
+- Multiplayer duet (using FoF file format)
- Recording performances
* Internet highscore
- Mic effects (reduce volume for bad singers, perfect pitch, reverb, etc)
- Ingame Singstar DVD support (integrated ripping + ffmpeg feeding + XML song format)
-- Dance game [WIP]
Features:
@@ -28,14 +25,15 @@ Features:
* Audio roundtrip by analyzing the sound captured by the microphone
* Controller/audio latency by playing blindly (listening to the beat only)
* Audio/video by playing visually without audio? (needs controller/audio calibrated)
-- Better audio card configuration ingame (needs PortAudio backend) [WIP]
+- Better audio card configuration ingame (needs PortAudio backend)
- Allow playing a single song given as commandline argument (no menus)
- Kiosk/arcade mode (disable exiting game and limit other functions)
Dance features:
+
- Colored arrows for timing
-- BGCHANGE support (background videos)
+- BGCHANGE support for SM format (background videos)
Text rendering bugs:
@@ -55,20 +53,10 @@ New config menu:
SS Ripper:
- Compress into Vorbis Ogg and H.264 MKV
+- Generate FoF format
Bugs:
-- On Compiz switching from fullscreen to window makes the window maximized even though the viewport stays small
-
- Segfault when browsing songs in song browser while loading (segfaults before loading finishes), quite rare
-- Bitmap surfaces are often loaded only partially, loading stops at a middle of a scanline.
- * Affects at least PNG format, maybe not others
- * The rest appears black or transparent (at least most of the time)
- * Reloading often causes different results on the same image
- * Different images may also stop at the exact same pixel
- => out of memory condition or something?
-
-- Instrument data files + catch
-
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 23:39:39
|
Module: performous Branch: master Commit: 36bb909d2ab41aba013c3c254bc5ef335e693f24 Author: Lasse Karkkainen <tro...@tr...> Date: Mon Jan 18 01:25:50 2010 +0200 Removed Markus' .gitignore which apparently listed his personal files --- game/.gitignore | 16 ---------------- 1 files changed, 0 insertions(+), 16 deletions(-) diff --git a/game/.gitignore b/game/.gitignore deleted file mode 100644 index 22bc235..0000000 --- a/game/.gitignore +++ /dev/null @@ -1,16 +0,0 @@ -*~ - -.ctags -Makefile - -config.hh - -database -performous.xml -database.xml - -highscore -highscore.txt - -players -players.xml |
|
From: Tapio V. <aa...@us...> - 2010-01-17 23:30:12
|
Module: performous
Branch: master
Commit: 92a1b9bb2db4f54d5dfae77ee1201e61b35ce953
Author: Tapio Vierros <tap...@gm...>
Date: Mon Jan 18 01:29:15 2010 +0200
Fix broken X-plorer guitar forcing.
---
game/joystick.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index e4a8654..2d17109 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -179,8 +179,8 @@ void input::SDL::init() {
std::map<unsigned int, input::detail::Type> forced_type;
using namespace boost::spirit::classic;
- rule<> type = str_p("GUITAR_GUITARHERO") | "GUITAR_ROCKBAND_PS3" | "GUITAR_ROCKBAND_XB360"
- | "GUITAR_GUITARHERO_XPLORER" | "DRUMS_GUITARHERO" | "DRUMS_ROCKBAND_PS3" | "DRUMS_ROCKBAND_XB360"
+ rule<> type = str_p("GUITAR_GUITARHERO_XPLORER") | "GUITAR_ROCKBAND_PS3" | "GUITAR_ROCKBAND_XB360"
+ | "GUITAR_GUITARHERO" | "DRUMS_GUITARHERO" | "DRUMS_ROCKBAND_PS3" | "DRUMS_ROCKBAND_XB360"
| "DRUMS_MIDI" | "DANCEPAD_GENERIC" | "DANCEPAD_TIGERGAME";
rule<> entry = uint_p[assign_a(sdl_id)] >> ":" >> (type)[assign_a(instrument_type)];
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 23:12:08
|
Module: performous
Branch: master
Commit: 9a9624edfdb8fb75a8cc909ad45ddc7b8df3c91e
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 01:11:41 2010 +0200
Extra second added before song start to allow playing the very first note of a song properly.
---
game/dancegraph.cc | 2 +-
game/guitargraph.cc | 2 +-
game/screen_sing.cc | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ad78a3b..3969dae 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -209,7 +209,7 @@ void DanceGraph::engine() {
for (input::Event ev; m_input.tryPoll(ev);) {
m_dead = 0; // Keep alive
if (m_jointime == not_joined) { // Handle joining
- m_jointime = (time < 0.0 ? -join_delay : time);
+ m_jointime = (time < -1.0 ? -1.0 - join_delay : time);
break;
}
// Difficulty / mode selection
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index eb5b040..a94875e 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -207,7 +207,7 @@ void GuitarGraph::engine() {
// breaks to be usable with FoF songs.
if (dead() && m_input.isKeyboard() && ev.type == input::Event::PICK) continue;
m_dead = 0; // Keep alive
- if (m_jointime == not_joined) m_jointime = (time < 0.0 ? -join_delay : time); // Handle joining
+ if (m_jointime == not_joined) m_jointime = (time < -1.0 ? -1.0 - join_delay : time); // Handle joining
// Handle Start/Select keypresses
if (ev.type == input::Event::PRESS && ev.button > input::STARPOWER_BUTTON) {
if (ev.button == 9) ev.button = input::STARPOWER_BUTTON; // Start works for GodMode
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 966b485..e4220a7 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -101,8 +101,8 @@ bool ScreenSing::instrumentLayout(double time) {
++i;
}
}
- if (time < -0.5) {
- glColor4f(1.0f, 1.0f, 1.0f, clamp(-1.0 - 2.0 * time));
+ if (time < -1.0) {
+ glColor4f(1.0f, 1.0f, 1.0f, clamp(-2.0 - 2.0 * time));
m_help->draw();
glColor3f(1.0f, 1.0f, 1.0f);
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 22:58:14
|
Module: performous
Branch: master
Commit: ee3604f03849c0b4dd13c1397f55a342f10b1ffc
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Jan 18 00:57:34 2010 +0200
Fix dance, b0rked by previous commit
---
game/screen_sing.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 3e48c20..966b485 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -54,7 +54,7 @@ void ScreenSing::enter() {
boost::ptr_vector<Analyzer>& analyzers = m_capture.analyzers();
m_layout_singer.reset(new LayoutSinger(*m_song, m_database, theme));
// Load instrument and dance tracks
- if (!m_song->track_map.empty()) {
+ {
int type = 0; // 0 for dance, 1 for guitars, 2 for drums
int idx = 0;
while (1) {
|
|
From: Yoda-JM <yo...@us...> - 2010-01-17 22:55:19
|
Module: performous Branch: master Commit: ec27e0e253a9e5c62fcad66fc59781a66d71fe16 Author: Vincent Le Ligeour <yo...@us...> Date: Sun Jan 17 23:54:59 2010 +0100 Removed performous.pot --- lang/performous.pot | 206 --------------------------------------------------- 1 files changed, 0 insertions(+), 206 deletions(-) diff --git a/lang/performous.pot b/lang/performous.pot deleted file mode 100644 index 9bbe78b..0000000 --- a/lang/performous.pot +++ /dev/null @@ -1,206 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-13 15:27+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" -"Language-Team: LANGUAGE <LL...@li...>\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../game/screen_hiscore.cc:104 -msgid "Hiscore for " -msgstr "" - -#: ../game/screen_intro.cc:10 -msgid "Perform" -msgstr "" - -#: ../game/screen_intro.cc:10 -msgid "Start performing!" -msgstr "" - -#: ../game/screen_intro.cc:11 -msgid "Practice" -msgstr "" - -#: ../game/screen_intro.cc:11 -msgid "Check your skills or test the microphones" -msgstr "" - -#: ../game/screen_intro.cc:12 -msgid "Configure" -msgstr "" - -#: ../game/screen_intro.cc:12 -msgid "Configure game options" -msgstr "" - -#: ../game/screen_intro.cc:13 -msgid "Quit" -msgstr "" - -#: ../game/screen_intro.cc:13 -msgid "Leave the game" -msgstr "" - -#: ../game/screen_intro.cc:21 -msgid "No playback devices could be used.\n" -msgstr "" - -#: ../game/screen_intro.cc:22 -msgid "No microphones found.\n" -msgstr "" - -#: ../game/screen_intro.cc:23 -msgid "" -"\n" -"Please configure some before playing." -msgstr "" - -#: ../game/screen_players.cc:109 -msgid "No players found!" -msgstr "" - -#: ../game/screen_players.cc:110 -msgid "Enter a name to create a new player." -msgstr "" - -#: ../game/screen_players.cc:112 -msgid "Press enter to create player!" -msgstr "" - -#: ../game/screen_players.cc:119 -#, boost-format -msgid "You reached %1% points!" -msgstr "" - -#: ../game/screen_players.cc:120 -msgid "Change player with arrow keys." -msgstr "" - -#: ../game/screen_players.cc:121 -msgid "Name:" -msgstr "" - -#: ../game/screen_players.cc:124 -msgid "Type text to filter or create a new player." -msgstr "" - -#: ../game/screen_players.cc:124 -msgid "Search Text:" -msgstr "" - -#: ../game/screen_sing.cc:338 -msgid " ENTER to skip instrumental break" -msgstr "" - -#: ../game/screen_sing.cc:339 -msgid " Remember to wait for grading!" -msgstr "" - -#: ../game/screen_sing.cc:427 -msgid "No player!" -msgstr "" - -#: ../game/screen_sing.cc:436 -msgid "Hit singer" -msgstr "" - -#: ../game/screen_sing.cc:437 -msgid "Lead singer" -msgstr "" - -#: ../game/screen_sing.cc:428 -msgid "Rising star" -msgstr "" - -#: ../game/screen_sing.cc:429 -msgid "Amateur" -msgstr "" - -#: ../game/screen_sing.cc:424 -msgid "Tone deaf" -msgstr "" - -#: ../game/screen_sing.cc:442 -msgid "Maniac" -msgstr "" - -#: ../game/screen_sing.cc:443 -msgid "Hoofer" -msgstr "" - -#: ../game/screen_sing.cc:446 -msgid "Loser" -msgstr "" - -#: ../game/screen_sing.cc:448 -msgid "Virtuoso" -msgstr "" - -#: ../game/screen_sing.cc:449 -msgid "Rocker" -msgstr "" - -#: ../game/screen_songs.cc:178 -msgid "No songs found!" -msgstr "" - -#: ../game/screen_songs.cc:179 -msgid "" -"Visit performous.org\n" -"for free songs" -msgstr "" - -#: ../game/screen_songs.cc:181 -msgid "no songs match search" -msgstr "" - -#: ../game/screen_songs.cc:188 -msgid "filter: " -msgstr "" - -#: ../game/screen_songs.cc:188 -msgid "none" -msgstr "" - -#: ../game/songs.cc:204 -msgid "random order" -msgstr "" - -#: ../game/songs.cc:205 -msgid "sorted by song" -msgstr "" - -#: ../game/songs.cc:206 -msgid "sorted by artist" -msgstr "" - -#: ../game/songs.cc:207 -msgid "sorted by edition" -msgstr "" - -#: ../game/songs.cc:208 -msgid "sorted by genre" -msgstr "" - -#: ../game/songs.cc:209 -msgid "sorted by path" -msgstr "" - -#: ../game/songs.cc:210 -msgid "sorted by language" -msgstr "" - -#: ../game/screen_songs.cc:196 -msgid "(press END to view hiscores)" -msgstr "" |
|
From: Yoda-JM <yo...@us...> - 2010-01-17 22:55:16
|
Module: performous Branch: master Commit: dd58514f823a0aaa816713da70d6fb13998af11a Author: Vincent Le Ligeour <yo...@us...> Date: Sun Jan 17 23:53:40 2010 +0100 Modified French translation --- lang/fr.po | 206 +++++++++++++++++++++++++++++++----------------------------- 1 files changed, 106 insertions(+), 100 deletions(-) diff --git a/lang/fr.po b/lang/fr.po index c292363..bcd50ec 100644 --- a/lang/fr.po +++ b/lang/fr.po @@ -2,9 +2,9 @@ msgid "" msgstr "" "Project-Id-Version: Performous\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-13 15:27+0100\n" +"POT-Creation-Date: 2010-01-17 23:51+0100\n" "PO-Revision-Date: \n" -"Last-Translator: Yoda-JM <yo...@us...>\n" +"Last-Translator: Vincent Le Ligeour <yo...@us...>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,9 +13,62 @@ msgstr "" "X-Poedit-Basepath: .\n" "X-Poedit-SearchPath-0: ../game\n" -#: ../game/screen_hiscore.cc:104 -msgid "Hiscore for " -msgstr "Records pour " +#: ../game/screen_sing.cc:307 +msgid " ENTER to skip instrumental break" +msgstr " \"Entrée\" pour passer l'instrumental" + +#: ../game/screen_sing.cc:308 +msgid " Remember to wait for grading!" +msgstr " N'oubliez pas d'attendre pour votre classement!" + +#: ../game/screen_sing.cc:396 +msgid "No player!" +msgstr "Aucun joueur n'a été trouvé!" + +#: ../game/screen_sing.cc:405 +msgid "Hit singer" +msgstr "Superstar" + +#: ../game/screen_sing.cc:406 +msgid "Lead singer" +msgstr "Soliste" + +#: ../game/screen_sing.cc:407 +#: ../game/screen_sing.cc:413 +#: ../game/screen_sing.cc:419 +msgid "Rising star" +msgstr "Etoile montante" + +#: ../game/screen_sing.cc:408 +#: ../game/screen_sing.cc:414 +#: ../game/screen_sing.cc:420 +msgid "Amateur" +msgstr "Amateur" + +#: ../game/screen_sing.cc:409 +#: ../game/screen_sing.cc:421 +msgid "Tone deaf" +msgstr "Casserole" + +#: ../game/screen_sing.cc:411 +msgid "Maniac" +msgstr "Maniac" + +#: ../game/screen_sing.cc:412 +msgid "Hoofer" +msgstr "Claquettiste" + +#: ../game/screen_sing.cc:415 +msgid "Loser" +msgstr "Perdant" + +#: ../game/screen_sing.cc:417 +msgid "Virtuoso" +msgstr "Virtuose" + +#: ../game/screen_sing.cc:418 +msgid "Rocker" +msgstr "Rockeur" #: ../game/screen_intro.cc:10 msgid "Perform" @@ -65,143 +118,96 @@ msgstr "" "\n" "Veuillez en configurer certains avant de jouer." -#: ../game/screen_players.cc:109 +#: ../game/screen_songs.cc:184 +msgid "No songs found!" +msgstr "Aucun morceau trouvé!" + +#: ../game/screen_songs.cc:185 +msgid "" +"Visit performous.org\n" +"for free songs" +msgstr "" +"Visitez performous.org\n" +"pour des morceaux gratuits" + +#: ../game/screen_songs.cc:187 +msgid "no songs match search" +msgstr "aucun morceau ne satisfait la recherche" + +#: ../game/screen_songs.cc:195 +msgid "(press END to view hiscores)" +msgstr "(presser Fin pour voir le classement)" + +#: ../game/screen_songs.cc:196 +msgid "<type in to search>" +msgstr "<Entrez votre recherche>" + +#: ../game/screen_hiscore.cc:88 +msgid "Hiscore for " +msgstr "Records pour " + +#: ../game/screen_players.cc:110 msgid "No players found!" msgstr "Aucun joueur n'a été trouvé!" -#: ../game/screen_players.cc:110 +#: ../game/screen_players.cc:111 msgid "Enter a name to create a new player." msgstr "Entrez un nom pour créer un nouveau joueur." -#: ../game/screen_players.cc:112 +#: ../game/screen_players.cc:113 msgid "Press enter to create player!" msgstr "Pressez Entrer pour créer un nouveau joueur!" -#: ../game/screen_players.cc:119 -#, boost-format +#: ../game/screen_players.cc:120 msgid "You reached %1% points!" msgstr "%1% points marqués!" -#: ../game/screen_players.cc:120 +#: ../game/screen_players.cc:121 msgid "Change player with arrow keys." msgstr "Changez de joueur avec les flèches" -#: ../game/screen_players.cc:121 +#: ../game/screen_players.cc:122 msgid "Name:" msgstr "Nom:" -#: ../game/screen_players.cc:124 +#: ../game/screen_players.cc:125 msgid "Type text to filter or create a new player." msgstr "Entrez un nom pour créer un nouveau joueur." -#: ../game/screen_players.cc:124 +#: ../game/screen_players.cc:125 msgid "Search Text:" msgstr "Recherche:" -#: ../game/screen_sing.cc:338 -msgid " ENTER to skip instrumental break" -msgstr " \"Entrée\" pour passer l'instrumental" - -#: ../game/screen_sing.cc:339 -msgid " Remember to wait for grading!" -msgstr " N'oubliez pas d'attendre pour votre classement!" - -#: ../game/screen_sing.cc:427 -msgid "No player!" -msgstr "Aucun joueur n'a été trouvé!" - -#: ../game/screen_sing.cc:436 -msgid "Hit singer" -msgstr "Superstar" - -#: ../game/screen_sing.cc:437 -msgid "Lead singer" -msgstr "Soliste" - -#: ../game/screen_sing.cc:428 -msgid "Rising star" -msgstr "Etoile montante" - -#: ../game/screen_sing.cc:429 -msgid "Amateur" -msgstr "Amateur" - -#: ../game/screen_sing.cc:424 -msgid "Tone deaf" -msgstr "Casserole" - -#: ../game/screen_sing.cc:442 -msgid "Maniac" -msgstr "Maniac" - -#: ../game/screen_sing.cc:443 -msgid "Hoofer" -msgstr "Claquettiste" - -#: ../game/screen_sing.cc:446 -msgid "Loser" -msgstr "Perdant" - -#: ../game/screen_sing.cc:448 -msgid "Virtuoso" -msgstr "Virtuose" - -#: ../game/screen_sing.cc:449 -msgid "Rocker" -msgstr "Rockeur" - -#: ../game/screen_songs.cc:178 -msgid "No songs found!" -msgstr "Aucun morceau trouvé!" - -#: ../game/screen_songs.cc:179 -msgid "" -"Visit performous.org\n" -"for free songs" -msgstr "" -"Visitez performous.org\n" -"pour des morceaux gratuits" - -#: ../game/screen_songs.cc:181 -msgid "no songs match search" -msgstr "aucun morceau ne satisfait la recherche" - -#: ../game/screen_songs.cc:188 -msgid "filter: " -msgstr "filtre: " - -#: ../game/screen_songs.cc:188 -msgid "none" -msgstr "aucun" - -#: ../game/songs.cc:204 +#: ../game/songs.cc:181 msgid "random order" msgstr "ordre aléatoire" -#: ../game/songs.cc:205 +#: ../game/songs.cc:182 msgid "sorted by song" msgstr "classement par chanson" -#: ../game/songs.cc:206 +#: ../game/songs.cc:183 msgid "sorted by artist" msgstr "classement par artiste" -#: ../game/songs.cc:207 +#: ../game/songs.cc:184 msgid "sorted by edition" msgstr "classement par édition" -#: ../game/songs.cc:208 +#: ../game/songs.cc:185 msgid "sorted by genre" msgstr "classement par genre" -#: ../game/songs.cc:209 +#: ../game/songs.cc:186 msgid "sorted by path" msgstr "classement par chemin" -#: ../game/songs.cc:210 +#: ../game/songs.cc:187 msgid "sorted by language" msgstr "classement par langue" -#: ../game/screen_songs.cc:196 -msgid "(press END to view hiscores)" -msgstr "(presser Fin pour voir le classement)" +#~ msgid "filter: " +#~ msgstr "filtre: " +#~ msgid "none" +#~ msgstr "aucun" + |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 22:17:05
|
Module: performous Branch: master Commit: 9fc9cf35ae1400cb3ec8c6afb13326572c0b6205 Author: Lasse Karkkainen <tro...@tr...> Date: Mon Jan 18 00:08:02 2010 +0200 Major input cleanup (still not the rewrite from scratch that it really needs). ScreenManager operation made exception-safe (avoiding errors getting ignored etc). Cleanup of instrument/dance adding loops in screen_sing. Regression: drums are now positioned first, before any guitars (instead of center like they should). --- game/guitargraph.cc | 120 +++++++++++++++++++------------------- game/guitargraph.hh | 4 +- game/joystick.cc | 148 ++++++++++++++++++++++------------------------- game/joystick.hh | 94 ++++++++++++----------------- game/main.cc | 1 + game/screen.hh | 5 +- game/screen_practice.cc | 5 +- game/screen_sing.cc | 49 ++++++---------- game/screenmanager.cc | 12 +++- game/song.hh | 3 + 10 files changed, 209 insertions(+), 232 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-01-17 22:16:51
|
Module: performous
Branch: master
Commit: 95d0a40cbb7df892f2f2a786d5da9794475e6f57
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Jan 17 08:19:48 2010 +0200
Handle running out of instruments properly so that other errors are not ignored by mistake.
---
game/joystick.hh | 6 +++++-
game/screen_sing.cc | 6 +++---
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index e55a9d5..356c025 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -111,6 +111,10 @@ namespace input {
int buttonFromSDL(input::Private::Type _type, unsigned int _sdl_button);
NavButton getNav(SDL_Event const &e);
+ 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
@@ -140,7 +144,7 @@ namespace input {
}
}
std::cout << "No InputDev was found!" << std::endl;
- throw std::runtime_error("No matching instrument available");
+ throw NoDevError();
};
~InputDev() {
using namespace input::Private;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index b8316cb..7412e6b 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -69,7 +69,7 @@ void ScreenSing::enter() {
Instruments::iterator ite = m_instruments.end();
m_instruments.insert(ite, new GuitarGraph(m_audio, *m_song, *it));
assigned = true;
- } catch (std::runtime_error&) {}
+ } catch (input::NoDevError&) {}
}
if( !assigned ) break;
}
@@ -78,7 +78,7 @@ void ScreenSing::enter() {
Instruments::iterator it = m_instruments.end();
if (m_instruments.size() > 1) it = m_instruments.begin() + 1; // Drums go after the first guitar
m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, "drums"));
- } catch (std::runtime_error&) { break; }
+ } catch (input::NoDevError&) { break; }
}
}
// Load dance tracks
@@ -86,7 +86,7 @@ void ScreenSing::enter() {
while(1) {
try {
m_dancers.push_back(new DanceGraph(m_audio, *m_song));
- } catch (std::runtime_error&) { break; }
+ } catch (input::NoDevError&) { break; }
}
}
// Startup delay for instruments is longer than for singing only
|