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: Yoda-JM <yo...@us...> - 2011-05-07 16:38:23
|
Author: Lasse Karkkainen <tro...@tr...> Date: Tue Mar 29 00:21:54 2011 +0200 Remove locales from config schema. Conflicts: data/schema.xml --- data/schema.xml | 198 ++++++++++++++++-------------------------------- game/configuration.cc | 28 ++++---- 2 files changed, 80 insertions(+), 146 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2011-05-07 16:38:15
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 28 23:54:42 2011 +0200
Enum values for config options and improved config parser diagnostics & error checking.
Conflicts:
data/schema.xml
---
game/configuration.cc | 45 +++++++++++++++++++++++++++++++++++----------
game/configuration.hh | 1 +
2 files changed, 36 insertions(+), 10 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index fdc1bcd..571a0f1 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -97,7 +97,11 @@ namespace {
}
std::string ConfigItem::getValue() const {
- if (m_type == "int") return numericFormat<int>(m_value, m_multiplier, m_step) + m_unit;
+ if (m_type == "int") {
+ int val = boost::get<int>(m_value);
+ if (val >= 0 && val < m_enums.size()) return m_enums[val];
+ return numericFormat<int>(m_value, m_multiplier, m_step) + m_unit;
+ }
if (m_type == "float") return numericFormat<double>(m_value, m_multiplier, m_step) + m_unit;
if (m_type == "bool") return boost::get<bool>(m_value) ? _("Enabled") : _("Disabled");
if (m_type == "string") return boost::get<std::string>(m_value);
@@ -131,12 +135,12 @@ namespace {
}
template <typename T, typename V> void setLimits(xmlpp::Element& e, V& min, V& max, V& step) {
- std::string value = getAttribute(e, "min");
- if (!value.empty()) min = boost::lexical_cast<T>(value);
- value = getAttribute(e, "max");
- if (!value.empty()) max = boost::lexical_cast<T>(value);
- value = getAttribute(e, "step");
- if (!value.empty()) step = boost::lexical_cast<T>(value);
+ xmlpp::Attribute* a = e.get_attribute("min");
+ if (a) min = boost::lexical_cast<T>(a->get_value());
+ a = e.get_attribute("max");
+ if (a) max = boost::lexical_cast<T>(a->get_value());
+ a = e.get_attribute("step");
+ if (a) step = boost::lexical_cast<T>(a->get_value());
}
}
@@ -162,10 +166,14 @@ template <typename T> void ConfigItem::updateNumeric(xmlpp::Element& elem, int m
}
}
-void ConfigItem::update(xmlpp::Element& elem, int mode) {
+
+void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (mode == 0) {
m_type = getAttribute(elem, "type");
if (m_type.empty()) throw std::runtime_error("Entry type attribute is missing");
+ } else {
+ std::string type = getAttribute(elem, "type");
+ if (!type.empty() && type != m_type) throw std::runtime_error("Entry type mismatch: " + getAttribute(elem, "name") + ": schema type = " + m_type + ", config type = " + type);
}
if (m_type == "bool") {
std::string value_string = getAttribute(elem, "value");
@@ -177,6 +185,19 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
} else if (m_type == "int") {
std::string value_string = getAttribute(elem, "value");
if (!value_string.empty()) m_value = boost::lexical_cast<int>(value_string);
+ // Enum handling
+ if (mode == 0) {
+ xmlpp::NodeSet n2 = elem.find("limits/enum");
+ if (!n2.empty()) {
+ for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
+ xmlpp::Element& elem2 = dynamic_cast<xmlpp::Element&>(**it2);
+ m_enums.push_back(elem2.get_child_text()->get_content());
+ }
+ m_min = 0;
+ m_max = int(m_enums.size() - 1);
+ m_step = 1;
+ }
+ }
updateNumeric<int>(elem, mode);
} else if (m_type == "float") {
std::string value_string = getAttribute(elem, "value");
@@ -200,8 +221,7 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
value.push_back(elem2.get_content());
}
m_value = value;
- }
-
+ } else if (!m_type.empty()) throw std::runtime_error("Invalid value type in config schema: " + m_type);
{
// Update short description
xmlpp::NodeSet n2 = elem.find("locale/short/text()");
@@ -220,6 +240,9 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
}
if (mode < 1) m_factoryDefaultValue = m_defaultValue = m_value;
if (mode < 2) m_defaultValue = m_value;
+} catch (std::exception& e) {
+ int line = elem.get_line();
+ throw std::runtime_error(boost::lexical_cast<std::string>(line) + ": Error while reading entry: " + e.what());
}
fs::path systemConfFile = "/etc/xdg/performous/config.xml";
@@ -334,6 +357,8 @@ void readConfigXML(fs::path const& file, int mode) {
int line = e.elem.get_line();
std::string name = e.elem.get_name();
throw std::runtime_error(file.string() + ":" + boost::lexical_cast<std::string>(line) + " element " + name + " " + e.message);
+ } catch (std::exception& e) {
+ throw std::runtime_error(file.string() + ":" + e.what());
}
}
diff --git a/game/configuration.hh b/game/configuration.hh
index 6699afd..82f2e6e 100644
--- a/game/configuration.hh
+++ b/game/configuration.hh
@@ -51,6 +51,7 @@ class ConfigItem {
Value m_value; ///< The current value
Value m_factoryDefaultValue; ///< The value from config schema
Value m_defaultValue; ///< The value from config schema or system config
+ std::vector<std::string> m_enums; ///< Enum value titles
boost::variant<int, double> m_step, m_min, m_max;
boost::variant<int, double> m_multiplier;
std::string m_unit;
|
|
From: Yoda-JM <yo...@us...> - 2011-05-07 16:38:08
|
Author: Vincent Le Ligeour <yo...@us...> Date: Fri May 6 21:35:02 2011 +0200 Added void pro guitar detection --- data/controllers.xml | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/data/controllers.xml b/data/controllers.xml index 23fbca1..4f99bce 100644 --- a/data/controllers.xml +++ b/data/controllers.xml @@ -96,6 +96,14 @@ <button id="9" value="start" /> </mapping> </controller> + <!-- Not managed + <controller type="guitar" name="GUITAR_PRO_PS3"> + <description>Rock Band Pro Guitar for PS3</description> + <regexp match="Licensed by Sony Computer Entertainment America Harmonix RB3 Mustang Guitar for PlayStation" /> + <mapping> + </mapping> + </controller> + --> <controller type="drumkit" name="DRUMS_GUITARHERO"> <description>Guitar Hero 4 drum kit (guessed, could be a guitar)</description> <regexp match="Guitar Hero4" /> |
|
From: Yoda-JM <yo...@us...> - 2011-05-07 16:22:54
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri May 6 22:28:08 2011 +0200
Fixed ss_extract command line flag parsing
---
tools/ss_extract.cpp | 54 ++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/tools/ss_extract.cpp b/tools/ss_extract.cpp
index 4a89125..9bf9ef5 100644
--- a/tools/ss_extract.cpp
+++ b/tools/ss_extract.cpp
@@ -36,9 +36,10 @@ std::string dvdPath;
std::ofstream txtfile;
int ts = 0;
int sleepts = -1;
-const bool video = true;
-const bool mkvcompress = false;
-const bool oggcompress = true;
+bool g_video = true;
+bool g_audio = true;
+bool g_mkvcompress = true;
+bool g_oggcompress = true;
void parseNote(xmlpp::Node* node) {
xmlpp::Element& elem = dynamic_cast<xmlpp::Element&>(*node);
@@ -157,11 +158,13 @@ struct Process {
remove = path;
dom.get_document()->write_to_file((path / "notes.xml").string(), "UTF-8");
Pak dataPak(song.dataPakName);
- std::cerr << ">>> Extracting and decoding music" << std::endl;
- try {
- music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
- } catch (...) {
- music_us(song, dataPak[id + "/mus+vid.iav"], dataPak[id + "/mus+vid.ind"], path);
+ if (g_audio) {
+ std::cerr << ">>> Extracting and decoding music" << std::endl;
+ try {
+ music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
+ } catch (...) {
+ music_us(song, dataPak[id + "/mus+vid.iav"], dataPak[id + "/mus+vid.ind"], path);
+ }
}
std::cerr << ">>> Extracting cover image" << std::endl;
try {
@@ -171,7 +174,7 @@ struct Process {
} catch (...) {}
remove = "";
// FIXME: use some library (preferrably ffmpeg):
- if (oggcompress) {
+ if (g_oggcompress) {
if( !song.music.empty() ) {
std::cerr << ">>> Compressing audio into music.ogg" << std::endl;
std::string cmd = "oggenc \"" + song.music.string() + "\"";
@@ -191,7 +194,7 @@ struct Process {
}
}
}
- if (video) {
+ if (g_video) {
std::cerr << ">>> Extracting video" << std::endl;
try {
std::vector<char> ipudata;
@@ -208,7 +211,7 @@ struct Process {
song.video = "";
}
}
- if (mkvcompress) {
+ if (g_mkvcompress) {
std::cerr << ">>> Compressing video and audio into music.mkv" << std::endl;
std::string cmd = "ffmpeg -i \"" + (path / "video.mpg").string() + "\" -vcodec libx264 -vpre hq -crf 25 -threads 0 -metadata album=\"" + song.edition + "\" -metadata author=\"" + song.artist + "\" -metadata comment=\"" + song.genre + "\" -metadata title=\"" + song.title + "\" \"" + (path / "video.m4v\"").string();
std::cerr << cmd << std::endl;
@@ -365,7 +368,34 @@ int main( int argc, char **argv) {
po::store(po::command_line_parser(argc, argv).options(opt).positional(pos).run(), vm);
po::notify(vm);
if (dvdPath.empty()) throw std::runtime_error("No Singstar DVD path specified. Enter a path to a folder with pack_ee.pak in it.");
- // TODO: process audio and video options and throw if they have incorrect values
+ // Process video flag
+ if (video == "none") {
+ g_video = false;
+ g_mkvcompress = false;
+ } else if (video == "mkv") {
+ g_video = true;
+ g_mkvcompress = true;
+ } else if (video == "mpeg2") {
+ g_video = true;
+ g_mkvcompress = false;
+ } else {
+ throw std::runtime_error("Invalid video flag. Value must be {none, mkv, mpeg2}");
+ }
+ std::cerr << ">>> Using video flag: \"" << video << "\"" << std::endl;
+ // Process audio flag
+ if (audio == "none") {
+ g_audio = false;
+ g_oggcompress = false;
+ } else if (audio == "ogg") {
+ g_audio = true;
+ g_oggcompress = true;
+ } else if (audio == "wav") {
+ g_audio = true;
+ g_oggcompress = false;
+ } else {
+ throw std::runtime_error("Invalid audio flag. Value must be {none, ogg, wav}");
+ }
+ std::cerr << ">>> Using audio flag: \"" << audio << "\"" << std::endl;
} catch (std::exception& e) {
std::cout << cmdline << std::endl;
std::cout << "ERROR: " << e.what() << std::endl;
|
|
From: Yoda-JM <yo...@us...> - 2011-05-07 15:22:21
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat May 7 17:00:22 2011 +0200
Fixed instrument gameplay
---
game/joystick.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index a5c52a9..29432ed 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -756,6 +756,9 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if(!dev.assigned()) return false;
if (dev.name() != "GUITAR_GUITARHERO_XPLORER" && (_e.jaxis.axis == 5 || _e.jaxis.axis == 6 || _e.jaxis.axis == 1)) {
event.type = input::Event::PICK;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = dev.pressed(i);
+ }
// Direction
if(_e.jaxis.value > 0 ) {
// down
|
|
From: Yoda-JM <yo...@us...> - 2011-05-07 15:22:10
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat May 7 17:00:22 2011 +0200
Fixed instrument gameplay
---
game/joystick.cc | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index a5c52a9..29432ed 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -756,6 +756,9 @@ bool input::SDL::pushEvent(SDL_Event _e) {
if(!dev.assigned()) return false;
if (dev.name() != "GUITAR_GUITARHERO_XPLORER" && (_e.jaxis.axis == 5 || _e.jaxis.axis == 6 || _e.jaxis.axis == 1)) {
event.type = input::Event::PICK;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = dev.pressed(i);
+ }
// Direction
if(_e.jaxis.value > 0 ) {
// down
|
|
From: Yoda-JM <yo...@us...> - 2011-05-06 20:28:33
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri May 6 22:28:08 2011 +0200
Fixed ss_extract command line flag parsing
---
tools/ss_extract.cpp | 54 ++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/tools/ss_extract.cpp b/tools/ss_extract.cpp
index 4a89125..9bf9ef5 100644
--- a/tools/ss_extract.cpp
+++ b/tools/ss_extract.cpp
@@ -36,9 +36,10 @@ std::string dvdPath;
std::ofstream txtfile;
int ts = 0;
int sleepts = -1;
-const bool video = true;
-const bool mkvcompress = false;
-const bool oggcompress = true;
+bool g_video = true;
+bool g_audio = true;
+bool g_mkvcompress = true;
+bool g_oggcompress = true;
void parseNote(xmlpp::Node* node) {
xmlpp::Element& elem = dynamic_cast<xmlpp::Element&>(*node);
@@ -157,11 +158,13 @@ struct Process {
remove = path;
dom.get_document()->write_to_file((path / "notes.xml").string(), "UTF-8");
Pak dataPak(song.dataPakName);
- std::cerr << ">>> Extracting and decoding music" << std::endl;
- try {
- music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
- } catch (...) {
- music_us(song, dataPak[id + "/mus+vid.iav"], dataPak[id + "/mus+vid.ind"], path);
+ if (g_audio) {
+ std::cerr << ">>> Extracting and decoding music" << std::endl;
+ try {
+ music(song, dataPak[id + "/music.mib"], pak["export/" + id + "/music.mih"], path);
+ } catch (...) {
+ music_us(song, dataPak[id + "/mus+vid.iav"], dataPak[id + "/mus+vid.ind"], path);
+ }
}
std::cerr << ">>> Extracting cover image" << std::endl;
try {
@@ -171,7 +174,7 @@ struct Process {
} catch (...) {}
remove = "";
// FIXME: use some library (preferrably ffmpeg):
- if (oggcompress) {
+ if (g_oggcompress) {
if( !song.music.empty() ) {
std::cerr << ">>> Compressing audio into music.ogg" << std::endl;
std::string cmd = "oggenc \"" + song.music.string() + "\"";
@@ -191,7 +194,7 @@ struct Process {
}
}
}
- if (video) {
+ if (g_video) {
std::cerr << ">>> Extracting video" << std::endl;
try {
std::vector<char> ipudata;
@@ -208,7 +211,7 @@ struct Process {
song.video = "";
}
}
- if (mkvcompress) {
+ if (g_mkvcompress) {
std::cerr << ">>> Compressing video and audio into music.mkv" << std::endl;
std::string cmd = "ffmpeg -i \"" + (path / "video.mpg").string() + "\" -vcodec libx264 -vpre hq -crf 25 -threads 0 -metadata album=\"" + song.edition + "\" -metadata author=\"" + song.artist + "\" -metadata comment=\"" + song.genre + "\" -metadata title=\"" + song.title + "\" \"" + (path / "video.m4v\"").string();
std::cerr << cmd << std::endl;
@@ -365,7 +368,34 @@ int main( int argc, char **argv) {
po::store(po::command_line_parser(argc, argv).options(opt).positional(pos).run(), vm);
po::notify(vm);
if (dvdPath.empty()) throw std::runtime_error("No Singstar DVD path specified. Enter a path to a folder with pack_ee.pak in it.");
- // TODO: process audio and video options and throw if they have incorrect values
+ // Process video flag
+ if (video == "none") {
+ g_video = false;
+ g_mkvcompress = false;
+ } else if (video == "mkv") {
+ g_video = true;
+ g_mkvcompress = true;
+ } else if (video == "mpeg2") {
+ g_video = true;
+ g_mkvcompress = false;
+ } else {
+ throw std::runtime_error("Invalid video flag. Value must be {none, mkv, mpeg2}");
+ }
+ std::cerr << ">>> Using video flag: \"" << video << "\"" << std::endl;
+ // Process audio flag
+ if (audio == "none") {
+ g_audio = false;
+ g_oggcompress = false;
+ } else if (audio == "ogg") {
+ g_audio = true;
+ g_oggcompress = true;
+ } else if (audio == "wav") {
+ g_audio = true;
+ g_oggcompress = false;
+ } else {
+ throw std::runtime_error("Invalid audio flag. Value must be {none, ogg, wav}");
+ }
+ std::cerr << ">>> Using audio flag: \"" << audio << "\"" << std::endl;
} catch (std::exception& e) {
std::cout << cmdline << std::endl;
std::cout << "ERROR: " << e.what() << std::endl;
|
|
From: Yoda-JM <yo...@us...> - 2011-05-06 19:35:37
|
Author: Vincent Le Ligeour <yo...@us...> Date: Fri May 6 21:35:02 2011 +0200 Added void pro guitar detection --- data/controllers.xml | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/data/controllers.xml b/data/controllers.xml index 23fbca1..4f99bce 100644 --- a/data/controllers.xml +++ b/data/controllers.xml @@ -96,6 +96,14 @@ <button id="9" value="start" /> </mapping> </controller> + <!-- Not managed + <controller type="guitar" name="GUITAR_PRO_PS3"> + <description>Rock Band Pro Guitar for PS3</description> + <regexp match="Licensed by Sony Computer Entertainment America Harmonix RB3 Mustang Guitar for PlayStation" /> + <mapping> + </mapping> + </controller> + --> <controller type="drumkit" name="DRUMS_GUITARHERO"> <description>Guitar Hero 4 drum kit (guessed, could be a guitar)</description> <regexp match="Guitar Hero4" /> |
|
From: Yoda-JM <yo...@us...> - 2011-05-06 19:35:30
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri May 6 21:33:51 2011 +0200
Added stereo mandatory extension check
---
game/video_driver.cc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 45933a5..4471648 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -77,6 +77,8 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
if (!GLEW_VERSION_2_1) throw std::runtime_error("OpenGL 2.1 is required but not available");
+ if (!GLEW_ARB_viewport_array && config["graphic/stereo3d"].b()) throw std::runtime_error("OpenGL extension ARB_viewport_array is required but not available when using stereo mode");
+
input::SDL::init(); // Joysticks etc.
if (GLEW_VERSION_3_3) {
|
|
From: Tapio V. <aa...@us...> - 2011-04-11 15:59:53
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Apr 11 18:58:40 2011 +0300 Added a PO template for tinkering with Launchpad translations. --- lang/performous.pot | 553 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 553 insertions(+), 0 deletions(-) |
|
From: Yoda-JM <yo...@us...> - 2011-04-10 23:02:06
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Apr 11 00:59:55 2011 +0200
Fixed regression in for old SingStar DVD cover decoding
---
tools/ss_cover.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/ss_cover.cpp b/tools/ss_cover.cpp
index 8019eb1..3b85420 100644
--- a/tools/ss_cover.cpp
+++ b/tools/ss_cover.cpp
@@ -88,7 +88,12 @@ SingstarCover::SingstarCover(const std::string pak_file, unsigned int track_id)
std::string tmp( buf.begin(), buf.end() );
dom.parse_memory(tmp);
xmlpp::NodeSet n = dom.get_document()->get_root_node()->find(xpath, nsmap);
- if (n.empty()) throw std::runtime_error("Unable to find cover informations");
+ if (n.empty()) {
+ std::string xpath_old = std::string("/TPAGE_BIT_SET/TPAGE_BIT[@NAME='") + id + "']";
+ n = dom.get_document()->get_root_node()->find(xpath_old, nsmap);
+ if (n.empty())
+ throw std::runtime_error("Unable to find cover informations");
+ }
xmlpp::Element& e = dynamic_cast<xmlpp::Element&>(*n[0]);
m_u = boost::lexical_cast<unsigned int>(e.get_attribute("U")->get_value());
m_v = boost::lexical_cast<unsigned int>(e.get_attribute("V")->get_value());
|
|
From: Yoda-JM <yo...@us...> - 2011-04-10 23:01:01
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Apr 11 00:59:55 2011 +0200
Fixed regression in for old SingStar DVD cover decoding
---
tools/ss_cover.cpp | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/tools/ss_cover.cpp b/tools/ss_cover.cpp
index 8019eb1..3b85420 100644
--- a/tools/ss_cover.cpp
+++ b/tools/ss_cover.cpp
@@ -88,7 +88,12 @@ SingstarCover::SingstarCover(const std::string pak_file, unsigned int track_id)
std::string tmp( buf.begin(), buf.end() );
dom.parse_memory(tmp);
xmlpp::NodeSet n = dom.get_document()->get_root_node()->find(xpath, nsmap);
- if (n.empty()) throw std::runtime_error("Unable to find cover informations");
+ if (n.empty()) {
+ std::string xpath_old = std::string("/TPAGE_BIT_SET/TPAGE_BIT[@NAME='") + id + "']";
+ n = dom.get_document()->get_root_node()->find(xpath_old, nsmap);
+ if (n.empty())
+ throw std::runtime_error("Unable to find cover informations");
+ }
xmlpp::Element& e = dynamic_cast<xmlpp::Element&>(*n[0]);
m_u = boost::lexical_cast<unsigned int>(e.get_attribute("U")->get_value());
m_v = boost::lexical_cast<unsigned int>(e.get_attribute("V")->get_value());
|
|
From: Tapio V. <aa...@us...> - 2011-04-03 18:42:26
|
Author: Tapio Vierros <tap...@gm...>
Date: Sun Apr 3 21:41:22 2011 +0300
Insert a space to each lyric imported from plain text.
---
notegraphwidget.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 919c9e4..ad4d4ea 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -73,7 +73,7 @@ void NoteGraphWidget::setLyrics(QString lyrics)
QString word;
ts2 >> word;
if (!word.isEmpty()) {
- Note note(word); note.end = NoteLabel::default_length; note.note = 24;
+ Note note(word + " "); note.end = NoteLabel::default_length; note.note = 24;
if (sentenceStart) note.lineBreak = true;
doOperation(opFromNote(note, m_notes.size(), !firstNote), Operation::NO_UPDATE);
firstNote = false;
|
|
From: Tapio V. <aa...@us...> - 2011-04-02 12:38:24
|
Author: Tapio Vierros <tap...@gm...>
Date: Sat Apr 2 15:37:36 2011 +0300
Fixed split action hiding notes.
---
notelabelmanager.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/notelabelmanager.cc b/notelabelmanager.cc
index 7bc695c..0a94b63 100644
--- a/notelabelmanager.cc
+++ b/notelabelmanager.cc
@@ -207,6 +207,7 @@ void NoteLabelManager::split(NoteLabel *note, float ratio)
doOperation(new2, Operation::NO_UPDATE);
doOperation(Operation("DEL", id+2), Operation::NO_UPDATE);
doOperation(Operation("COMBINER", 3)); // This will combine the previous ones to one undo action
+ startNotePixmapUpdates();
}
void NoteLabelManager::del(NoteLabel *note)
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-28 22:44:31
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Mar 29 00:43:59 2011 +0200
Less copypasta, more beef.
---
game/configuration.cc | 36 ++++++++----------------------------
1 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 9d383ff..3f6144d 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -171,6 +171,9 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (mode == 0) {
m_type = getAttribute(elem, "type");
if (m_type.empty()) throw std::runtime_error("Entry type attribute is missing");
+ // Menu text
+ m_shortDesc = getText(elem, "short");
+ m_longDesc = getText(elem, "long");
} else {
std::string type = getAttribute(elem, "type");
if (!type.empty() && type != m_type) throw std::runtime_error("Entry type mismatch: " + getAttribute(elem, "name") + ": schema type = " + m_type + ", config type = " + type);
@@ -191,7 +194,7 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (!n2.empty()) {
for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
xmlpp::Element& elem2 = dynamic_cast<xmlpp::Element&>(**it2);
- m_enums.push_back(elem2.get_child_text()->get_content());
+ m_enums.push_back(getText(elem2));
}
m_min = 0;
m_max = int(m_enums.size() - 1);
@@ -204,40 +207,17 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (!value_string.empty()) m_value = boost::lexical_cast<double>(value_string);
updateNumeric<double>(elem, mode);
} else if (m_type == "string") {
- xmlpp::NodeSet n2 = elem.find("stringvalue/text()");
- // FIXME: WTF does this loop do? Does find actually return many elements and why?
- std::string value;
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- value = elem2.get_content();
- }
- m_value = value;
+ m_value = getText(elem, "stringvalue");
} else if (m_type == "string_list" || m_type == "option_list") {
//TODO: Option list should also update selection (from attribute?)
std::vector<std::string> value;
- xmlpp::NodeSet n2 = elem.find("stringvalue/text()");
+ xmlpp::NodeSet n2 = elem.find("stringvalue");
for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- value.push_back(elem2.get_content());
+ value.push_back(getText(dynamic_cast<xmlpp::Element const&>(**it2)));
}
m_value = value;
} else if (!m_type.empty()) throw std::runtime_error("Invalid value type in config schema: " + m_type);
- {
- // Update short description
- xmlpp::NodeSet n2 = elem.find("short/text()");
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- m_shortDesc = elem2.get_content();
- }
- }
- {
- // Update long description
- xmlpp::NodeSet n2 = elem.find("long/text()");
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- m_longDesc = elem2.get_content();
- }
- }
+ // Schema sets all defaults, system config sets the system default
if (mode < 1) m_factoryDefaultValue = m_defaultValue = m_value;
if (mode < 2) m_defaultValue = m_value;
} catch (std::exception& e) {
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-28 22:44:22
|
Author: Lasse Karkkainen <tro...@tr...> Date: Tue Mar 29 00:21:54 2011 +0200 Remove locales from config schema. --- data/schema.xml | 216 ++++++++++++++++-------------------------------- game/configuration.cc | 28 +++--- 2 files changed, 86 insertions(+), 158 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-28 21:55:59
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Mar 28 23:54:42 2011 +0200
Enum values for config options and improved config parser diagnostics & error checking.
---
data/schema.xml | 8 ++++++--
game/configuration.cc | 45 +++++++++++++++++++++++++++++++++++----------
game/configuration.hh | 1 +
3 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 3219b2f..4c1ee9e 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -132,10 +132,14 @@ to save the current settings to XML.
</locale>
</entry>
<entry name="graphic/stereo3dtype" type="int" value="0">
- <limits min="0" max="2" step="1" />
+ <limits>
+ <enum>Red/Cyan</enum>
+ <enum>Green/Magenta</enum>
+ <enum>Over/Under</enum>
+ </limits>
<locale name="C">
<short>Stereo3D type</short>
- <long>Some modes may only be activated in fullscreen mode. 0 = red/cyan, 1 = green/magenta, 2 = over/under.</long>
+ <long>Some modes may only get activated in fullscreen mode.</long>
</locale>
</entry>
<entry name="graphic/stereo3dseparation" type="float" value="50">
diff --git a/game/configuration.cc b/game/configuration.cc
index fdc1bcd..571a0f1 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -97,7 +97,11 @@ namespace {
}
std::string ConfigItem::getValue() const {
- if (m_type == "int") return numericFormat<int>(m_value, m_multiplier, m_step) + m_unit;
+ if (m_type == "int") {
+ int val = boost::get<int>(m_value);
+ if (val >= 0 && val < m_enums.size()) return m_enums[val];
+ return numericFormat<int>(m_value, m_multiplier, m_step) + m_unit;
+ }
if (m_type == "float") return numericFormat<double>(m_value, m_multiplier, m_step) + m_unit;
if (m_type == "bool") return boost::get<bool>(m_value) ? _("Enabled") : _("Disabled");
if (m_type == "string") return boost::get<std::string>(m_value);
@@ -131,12 +135,12 @@ namespace {
}
template <typename T, typename V> void setLimits(xmlpp::Element& e, V& min, V& max, V& step) {
- std::string value = getAttribute(e, "min");
- if (!value.empty()) min = boost::lexical_cast<T>(value);
- value = getAttribute(e, "max");
- if (!value.empty()) max = boost::lexical_cast<T>(value);
- value = getAttribute(e, "step");
- if (!value.empty()) step = boost::lexical_cast<T>(value);
+ xmlpp::Attribute* a = e.get_attribute("min");
+ if (a) min = boost::lexical_cast<T>(a->get_value());
+ a = e.get_attribute("max");
+ if (a) max = boost::lexical_cast<T>(a->get_value());
+ a = e.get_attribute("step");
+ if (a) step = boost::lexical_cast<T>(a->get_value());
}
}
@@ -162,10 +166,14 @@ template <typename T> void ConfigItem::updateNumeric(xmlpp::Element& elem, int m
}
}
-void ConfigItem::update(xmlpp::Element& elem, int mode) {
+
+void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (mode == 0) {
m_type = getAttribute(elem, "type");
if (m_type.empty()) throw std::runtime_error("Entry type attribute is missing");
+ } else {
+ std::string type = getAttribute(elem, "type");
+ if (!type.empty() && type != m_type) throw std::runtime_error("Entry type mismatch: " + getAttribute(elem, "name") + ": schema type = " + m_type + ", config type = " + type);
}
if (m_type == "bool") {
std::string value_string = getAttribute(elem, "value");
@@ -177,6 +185,19 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
} else if (m_type == "int") {
std::string value_string = getAttribute(elem, "value");
if (!value_string.empty()) m_value = boost::lexical_cast<int>(value_string);
+ // Enum handling
+ if (mode == 0) {
+ xmlpp::NodeSet n2 = elem.find("limits/enum");
+ if (!n2.empty()) {
+ for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
+ xmlpp::Element& elem2 = dynamic_cast<xmlpp::Element&>(**it2);
+ m_enums.push_back(elem2.get_child_text()->get_content());
+ }
+ m_min = 0;
+ m_max = int(m_enums.size() - 1);
+ m_step = 1;
+ }
+ }
updateNumeric<int>(elem, mode);
} else if (m_type == "float") {
std::string value_string = getAttribute(elem, "value");
@@ -200,8 +221,7 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
value.push_back(elem2.get_content());
}
m_value = value;
- }
-
+ } else if (!m_type.empty()) throw std::runtime_error("Invalid value type in config schema: " + m_type);
{
// Update short description
xmlpp::NodeSet n2 = elem.find("locale/short/text()");
@@ -220,6 +240,9 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) {
}
if (mode < 1) m_factoryDefaultValue = m_defaultValue = m_value;
if (mode < 2) m_defaultValue = m_value;
+} catch (std::exception& e) {
+ int line = elem.get_line();
+ throw std::runtime_error(boost::lexical_cast<std::string>(line) + ": Error while reading entry: " + e.what());
}
fs::path systemConfFile = "/etc/xdg/performous/config.xml";
@@ -334,6 +357,8 @@ void readConfigXML(fs::path const& file, int mode) {
int line = e.elem.get_line();
std::string name = e.elem.get_name();
throw std::runtime_error(file.string() + ":" + boost::lexical_cast<std::string>(line) + " element " + name + " " + e.message);
+ } catch (std::exception& e) {
+ throw std::runtime_error(file.string() + ":" + e.what());
}
}
diff --git a/game/configuration.hh b/game/configuration.hh
index 6699afd..82f2e6e 100644
--- a/game/configuration.hh
+++ b/game/configuration.hh
@@ -51,6 +51,7 @@ class ConfigItem {
Value m_value; ///< The current value
Value m_factoryDefaultValue; ///< The value from config schema
Value m_defaultValue; ///< The value from config schema or system config
+ std::vector<std::string> m_enums; ///< Enum value titles
boost::variant<int, double> m_step, m_min, m_max;
boost::variant<int, double> m_multiplier;
std::string m_unit;
|
|
From: Tapio V. <aa...@us...> - 2011-03-15 18:18:12
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 15 20:17:11 2011 +0200
Preserve tailing whitespace in US TXT import (for wording).
---
songparser-txt.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/songparser-txt.cc b/songparser-txt.cc
index 526fc0e..64a12ac 100644
--- a/songparser-txt.cc
+++ b/songparser-txt.cc
@@ -67,7 +67,11 @@ bool SongParser::txtParseField(QString const& line) {
bool SongParser::txtParseNote(QString line, VocalTrack &vocal) {
if (line.isEmpty() || line == "\r") return true;
- line = line.trimmed();
+ // Trim leading whitespace (after is preserved for word breaking purposes)
+ while (line[0].isSpace()) {
+ line = line.mid(1);
+ if (line.isEmpty()) return true;
+ }
if (line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if (line[0] == 'E') return false;
QTextStream iss(&line);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 06:52:55
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sun Mar 13 07:52:02 2011 +0100 Prototyping dance gameplay in 3d --- data/shaders/dancenote.vert | 14 ++++++- game/dancegraph.cc | 50 ++++++++++++++++++------ themes/default/dancebeat.svg | 87 +++++++++++++++++++++++++---------------- 3 files changed, 102 insertions(+), 49 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 02:24:02
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 13 03:23:48 2011 +0100
Dance rank text 3d effects
---
game/dancegraph.cc | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ed34b53..54039aa 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -524,16 +524,19 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
}
// Draw a text telling how well we hit
+ double alpha = 1.0 - glow;
if (!mine && note.isHit) {
std::string text;
if (note.releaseTime <= 0.0 && tBeg < tEnd) { // Is being held down and is a hold note
text = "HOLD";
- glow = 1.0;
+ alpha = glow = 1.0;
} else if (glow > 0.0) { // Released already, display rank
text = note.score ? getRank(note.error) : "FAIL!";
}
if (!text.empty()) {
- double sc = getScale() * 1.2 * arrowSize * (1.0 + glow);
+ double sc = getScale() * 0.6 * arrowSize * (3.0 + glow);
+ Transform trans(glmath::translate(glmath::vec3(0.0, 0.0, 0.5 * glow))); // Slightly elevated
+ ColorTrans c(Color(1.0, 1.0, 1.0, std::sqrt(alpha)));
m_popupText->render(text);
m_popupText->dimensions().middle(x).center(time2y(0.0)).stretch(sc, sc/2.0);
m_popupText->draw();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 01:39:35
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 13 02:39:14 2011 +0100
New glmath functions for vectors, fixed neckglow that was broken a few commits back (possibly a better implementation now)
---
game/glmath.hh | 8 ++++++++
game/guitargraph.cc | 39 ++++++++++++++++-----------------------
game/guitargraph.hh | 2 +-
3 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/game/glmath.hh b/game/glmath.hh
index 2f1da54..b65e30d 100644
--- a/game/glmath.hh
+++ b/game/glmath.hh
@@ -9,6 +9,10 @@
namespace glmath {
+ template <typename T> T mix(T const& a, T const& b, double blend) {
+ return (1.0-blend) * a + blend * b;
+ }
+
struct vec4;
struct vec3 {
@@ -32,6 +36,10 @@ namespace glmath {
inline vec3::vec3(vec4 const& v): x(v.x), y(v.y), z(v.z) {}
static inline vec3 operator*(float k, vec3 const& v) { return vec3(k * v.x, k * v.y, k * v.z); }
+ static inline vec4 operator*(float k, vec4 const& v) { return vec4(k * v.x, k * v.y, k * v.z, k * v.w); }
+
+ static inline vec3 operator+(vec3 const& a, vec4 const& b) { return vec3(a.x + b.x, a.y + b.y, a.z + b.z); }
+ static inline vec4 operator+(vec4 const& a, vec4 const& b) { return vec4(a.x + b.x, a.y + b.y, a.z + b.z, a.w + b.w); }
static inline float dot(vec3 const& a, vec3 const& b) {
return a.x * b.x + a.y * b.y + a.z * b.z;
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 116e741..f3519e9 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -784,10 +784,6 @@ namespace {
}
}
- // EVIL GLOBALS, FIXME!
- float ng_r = 0, ng_g = 0, ng_b = 0; // neck glow color components
- int ng_ccnt = 0; // neck glow color count
-
}
void GuitarGraph::drawNotes(double time) {
@@ -805,6 +801,9 @@ void GuitarGraph::drawNotes(double time) {
}
}
if (time != time) return; // Check that time is not NaN
+
+ glmath::vec4 neckglow; // Used for calculating the average neck color
+
// Iterate chords
for (Chords::iterator it = m_chords.begin(); it != m_chords.end(); ++it) {
float tBeg = it->begin - time;
@@ -841,7 +840,7 @@ void GuitarGraph::drawNotes(double time) {
if (!joining(time)) {
// Get a color for the fret and adjust it if GodMode is on
c = colorize(color(fret), it->begin);
- if (glow > 0.1f) { ng_r+=c.r; ng_g+=c.g; ng_b+=c.b; ng_ccnt++; } // neck glow
+ if (glow > 0.1f) { neckglow = neckglow + glmath::vec4(c.r, c.g, c.b, 1.0); } // neck glow tracking
// Further adjust the color if the note is hit
c.r += glow * 0.2f;
c.g += glow * 0.2f;
@@ -873,6 +872,11 @@ void GuitarGraph::drawNotes(double time) {
}
}
}
+ // Mangle neck glow color as needed
+ // Convert sum into average and apply correctness as premultiplied alpha
+ if (neckglow.w > 0.0) neckglow = (correctness() / neckglow.w) * neckglow;
+ // Blend into use slowly
+ m_neckglowColor = glmath::mix(m_neckglowColor, neckglow, 0.05);
}
double GuitarGraph::neckWidth() const { return std::min(0.5, m_width.get()); }
@@ -1006,24 +1010,13 @@ void GuitarGraph::draw(double time) {
ViewTrans view(m_cx.get(), 0.0, 0.75); // Apply a per-player local perspective
drawNeckStuff(time);
-
- // Bottom neck glow
- if (ng_ccnt > 0) {
- // Mangle color
- if (m_neckglowColor.r > 0 || m_neckglowColor.g > 0 || m_neckglowColor.b > 0) {
- m_neckglowColor.r = blend(m_neckglowColor.r, ng_r / ng_ccnt, 0.95);
- m_neckglowColor.g = blend(m_neckglowColor.g, ng_g / ng_ccnt, 0.95);
- m_neckglowColor.b = blend(m_neckglowColor.b, ng_b / ng_ccnt, 0.95);
- } else { // We don't want to fade from black in the start
- m_neckglowColor.r = ng_r / ng_ccnt;
- m_neckglowColor.g = ng_g / ng_ccnt;
- m_neckglowColor.b = ng_b / ng_ccnt;
- }
- m_neckglowColor.a = correctness();
- }
- if (correctness() > 0) {
- // Glow drawing
- ColorTrans c(m_neckglowColor);
+
+ if (m_neckglowColor.w > 0.0) {
+ // Neck glow drawing
+ using namespace glmath;
+ double a = m_neckglowColor.w;
+ vec4 color((1.0 / a) * vec3(m_neckglowColor), a); // Convert into non-premultiplied
+ ColorTrans c(glmath::mat4::diagonal(color));
m_neckglow.dimensions.screenBottom(0.0).middle().fixedWidth(neckWidth());
m_neckglow.draw();
}
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 2e68b0d..dd97ffb 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -88,7 +88,7 @@ class GuitarGraph: public InstrumentGraph {
Texture m_flame_godmode;
Surface m_tap; /// image for 2d HOPO note cap
Surface m_neckglow; /// image for the glow from the bottom of the neck
- Color m_neckglowColor;
+ glmath::vec4 m_neckglowColor;
Object3d m_fretObj; /// 3d object for regular note
Object3d m_tappableObj; /// 3d object for the HOPO note cap
std::vector<std::string> m_samples; /// sound effects
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 00:51:50
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sun Mar 13 01:49:00 2011 +0100 Merge branch 'gl2cleanup' into opengl2 --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 00:51:43
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Mar 13 01:44:37 2011 +0100
Notelines fixes and cleanup
---
game/notegraph.cc | 82 ++++++++++++++++++++++++++--------------------------
1 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 2424160..39f0fc8 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -108,6 +108,13 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
m_baseY = -0.5 * (m_min + m_max) * m_noteUnit + dimensions.yc();
m_baseX = baseLine - m_time * pixUnit + dimensions.xc(); // FIXME: Moving in X direction requires additional love (is b0rked now, keep it centered at zero)
+ // Fading notelines handing
+ if (m_songit == m_vocal.notes.end() || m_songit->begin > m_time + 3.0) m_notealpha -= 0.02f;
+ else if (m_notealpha < 1.0f) m_notealpha += 0.02f;
+ if (m_notealpha <= 0.0f) { m_notealpha = 0.0f; return; }
+
+ ColorTrans c(Color(1.0, 1.0, 1.0, m_notealpha));
+
drawNotes();
if (config["game/pitch"].b()) drawWaves(database);
@@ -120,7 +127,7 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
float hh = -m_noteUnit;
float centery = m_baseY + (it->note + 0.4) * m_noteUnit; // Star is 0.4 notes higher than current note
float centerx = x + w - (player_star_offset + 1.2) * hh; // Star is 1.2 units from end
- float rot = fmod(time * 360, 360); // They rotate!
+ float rot = fmod(time * 5.0, 2.0 * M_PI); // They rotate!
float zoom = (std::abs((rot-180) / 360.0f) * 0.8f + 0.6f) * (position == NoteGraph::TOP ? 2.3 : 2.0) * hh;
using namespace glmath;
Transform trans(translate(vec3(centerx, centery, 0.0f)) * rotate(rot, vec3(0.0f, 0.0f, 1.0f)));
@@ -136,47 +143,40 @@ void NoteGraph::draw(double time, Database const& database, Position position) {
void NoteGraph::drawNotes() {
// Draw note lines
- if (m_songit == m_vocal.notes.end() || m_songit->begin > m_time + 3.0) m_notealpha -= 0.02f;
- else if (m_notealpha < 1.0f) m_notealpha += 0.02f;
- if (m_notealpha <= 0.0f) {
- m_notealpha = 0.0f;
- } else {
- ColorTrans c(Color(1.0, 1.0, 1.0, m_notealpha));
- m_notelines.draw(Dimensions().stretch(dimensions.w(), (m_max - m_min - 13) * m_noteUnit).middle(dimensions.xc()).center(dimensions.yc()), TexCoords(0.0, (-m_min - 7.0) / 12.0f, 1.0, (-m_max + 6.0) / 12.0f));
-
- // Draw notes
- for (Notes::const_iterator it = m_songit; it != m_vocal.notes.end() && it->begin < m_time - (baseLine - 0.5) / pixUnit; ++it) {
- if (it->type == Note::SLEEP) continue;
- double alpha = it->power;
- Texture* t1;
- Texture* t2;
- switch (it->type) {
- case Note::NORMAL: case Note::SLIDE: t1 = &m_notebar; t2 = &m_notebar_hl; break;
- case Note::GOLDEN: t1 = &m_notebargold; t2 = &m_notebargold_hl; break;
- case Note::FREESTYLE: // Freestyle notes use custom handling
- {
- Dimensions dim;
- dim.middle(m_baseX + 0.5 * (it->begin + it->end) * pixUnit).center(m_baseY + it->note * m_noteUnit).stretch((it->end - it->begin) * pixUnit, -m_noteUnit * 12.0);
- float xoffset = 0.1 * m_time / m_notebarfs.ar();
- m_notebarfs.draw(dim, TexCoords(xoffset, 0.0, xoffset + dim.ar() / m_notebarfs.ar(), 1.0));
- if (alpha > 0.0) {
- float xoffset = rand() / double(RAND_MAX);
- m_notebarfs_hl.draw(dim, TexCoords(xoffset, 0.0, xoffset + dim.ar() / m_notebarfs_hl.ar(), 1.0));
- }
+ m_notelines.draw(Dimensions().stretch(dimensions.w(), (m_max - m_min - 13) * m_noteUnit).middle(dimensions.xc()).center(dimensions.yc()), TexCoords(0.0, (-m_min - 7.0) / 12.0f, 1.0, (-m_max + 6.0) / 12.0f));
+
+ // Draw notes
+ for (Notes::const_iterator it = m_songit; it != m_vocal.notes.end() && it->begin < m_time - (baseLine - 0.5) / pixUnit; ++it) {
+ if (it->type == Note::SLEEP) continue;
+ double alpha = it->power;
+ Texture* t1;
+ Texture* t2;
+ switch (it->type) {
+ case Note::NORMAL: case Note::SLIDE: t1 = &m_notebar; t2 = &m_notebar_hl; break;
+ case Note::GOLDEN: t1 = &m_notebargold; t2 = &m_notebargold_hl; break;
+ case Note::FREESTYLE: // Freestyle notes use custom handling
+ {
+ Dimensions dim;
+ dim.middle(m_baseX + 0.5 * (it->begin + it->end) * pixUnit).center(m_baseY + it->note * m_noteUnit).stretch((it->end - it->begin) * pixUnit, -m_noteUnit * 12.0);
+ float xoffset = 0.1 * m_time / m_notebarfs.ar();
+ m_notebarfs.draw(dim, TexCoords(xoffset, 0.0, xoffset + dim.ar() / m_notebarfs.ar(), 1.0));
+ if (alpha > 0.0) {
+ float xoffset = rand() / double(RAND_MAX);
+ m_notebarfs_hl.draw(dim, TexCoords(xoffset, 0.0, xoffset + dim.ar() / m_notebarfs_hl.ar(), 1.0));
}
- continue;
- default: throw std::logic_error("Unknown note type: don't know how to render");
- }
- double x = m_baseX + it->begin * pixUnit + m_noteUnit; // left x coordinate: begin minus border (side borders -noteUnit wide)
- double ybeg = m_baseY + (it->notePrev + 1) * m_noteUnit; // top y coordinate (on the one higher note line)
- double yend = m_baseY + (it->note + 1) * m_noteUnit; // top y coordinate (on the one higher note line)
- double w = (it->end - it->begin) * pixUnit - m_noteUnit * 2.0; // width: including borders on both sides
- double h = -m_noteUnit * 2.0; // height: 0.5 border + 1.0 bar + 0.5 border = 2.0
- drawNotebar(*t1, x, ybeg, yend, w, h);
- if (alpha > 0.0) {
- ColorTrans c(Color(1.0f, 1.0f, 1.0f, alpha));
- drawNotebar(*t2, x, ybeg, yend, w, h);
}
+ continue;
+ default: throw std::logic_error("Unknown note type: don't know how to render");
+ }
+ double x = m_baseX + it->begin * pixUnit + m_noteUnit; // left x coordinate: begin minus border (side borders -noteUnit wide)
+ double ybeg = m_baseY + (it->notePrev + 1) * m_noteUnit; // top y coordinate (on the one higher note line)
+ double yend = m_baseY + (it->note + 1) * m_noteUnit; // top y coordinate (on the one higher note line)
+ double w = (it->end - it->begin) * pixUnit - m_noteUnit * 2.0; // width: including borders on both sides
+ double h = -m_noteUnit * 2.0; // height: 0.5 border + 1.0 bar + 0.5 border = 2.0
+ drawNotebar(*t1, x, ybeg, yend, w, h);
+ if (alpha > 0.0) {
+ ColorTrans c(Color(1.0f, 1.0f, 1.0f, alpha));
+ drawNotebar(*t2, x, ybeg, yend, w, h);
}
}
}
@@ -206,7 +206,7 @@ void NoteGraph::drawWaves(Database const& database) {
double oldval = getNaN();
glutil::VertexArray va;
Notes::const_iterator noteIt = m_vocal.notes.begin();
- glmath::vec4 c(p->m_color.r, p->m_color.g, p->m_color.b, m_notealpha);
+ glmath::vec4 c(p->m_color.r, p->m_color.g, p->m_color.b, 1.0);
for (; idx < endIdx; ++idx, t += Engine::TIMESTEP) {
double const freq = pitch[idx].first;
// If freq is NaN, we have nothing to process
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 00:51:37
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sun Mar 13 01:30:50 2011 +0100 Various guitargraph graphics fixes and major cleanup. --- game/guitargraph.cc | 429 ++++++++++++++++++++++++++------------------------- game/guitargraph.hh | 6 +- 2 files changed, 219 insertions(+), 216 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-03-13 00:51:30
|
Author: Lasse Karkkainen <tro...@tr...> Date: Sat Mar 12 23:56:33 2011 +0100 Proper color setting stack (new operation multiplies the previous one). Text rendering no longer takes alpha parameter. --- game/dancegraph.cc | 1 - game/guitargraph.cc | 54 +++++++++++++++++++++--------------------- game/instrumentgraph.cc | 3 +- game/instrumentgraph.hh | 4 +- game/layout_singer.cc | 4 +- game/layout_singer.hh | 3 +- game/notegraph.cc | 6 ++-- game/opengl_text.cc | 17 ++++-------- game/opengl_text.hh | 4 +- game/screen_audiodevices.cc | 5 ++- game/screen_intro.cc | 15 ++++++++---- game/screen_players.cc | 3 +- game/screen_sing.cc | 6 ++-- game/screen_songs.cc | 4 +- game/screenmanager.cc | 5 ++- game/video.cc | 2 +- game/video_driver.cc | 25 +++++++++++++++---- game/video_driver.hh | 33 +++++++++++--------------- 18 files changed, 103 insertions(+), 91 deletions(-) |