You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:28:01
|
Module: performous
Branch: joinmenu
Commit: 50f43a7b2d262320ca55ae2654e4cc539ee2b0af
Author: Tapio Vierros <tap...@gm...>
Date: Wed Aug 11 19:02:48 2010 +0300
Allow configuring which webcam to use.
---
data/schema.xml | 7 +++++++
game/screen_sing.cc | 4 ++--
game/webcam.cc | 12 +++++++++---
3 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/data/schema.xml b/data/schema.xml
index 1eea68e..2352133 100644
--- a/data/schema.xml
+++ b/data/schema.xml
@@ -124,6 +124,13 @@ to save the current settings to XML.
<long>Performous can try to use webcam as a background video. You can disable it if it annoys you.</long>
</locale>
</entry>
+ <entry name="graphic/webcamid" type="int" value="-1">
+ <limits min="-1" max="9" step="1" />
+ <locale name="C">
+ <short>Webcam id</short>
+ <long>Use -1 to autodetect or a number starting from 0 to choose specific device.</long>
+ </locale>
+ </entry>
<entry name="graphic/3d_notes" type="bool" value="true">
<locale name="C">
<short>3D notes</short>
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index dd822f3..e4ea994 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -59,7 +59,7 @@ void ScreenSing::enter() {
}
// Initialize webcam
if (config["graphic/webcam"].b() && Webcam::enabled()) {
- m_cam.reset(new Webcam());
+ m_cam.reset(new Webcam(config["graphic/webcamid"].i()));
}
// Load video
if (!m_song->video.empty() && config["graphic/video"].b()) {
@@ -253,7 +253,7 @@ void ScreenSing::manageEvent(SDL_Event event) {
if (key == SDLK_w) dispInFlash(++config["game/pitch"]); // Toggle pitch wave
// Toggle webcam
if (key == SDLK_a && Webcam::enabled()) {
- if (!m_cam) m_cam.reset(new Webcam()); // Initialize if we haven't done that already
+ if (!m_cam) m_cam.reset(new Webcam(config["graphic/webcamid"].i())); // Initialize if we haven't done that already
if (m_cam) { dispInFlash(++config["graphic/webcam"]); m_cam->pause(!config["graphic/webcam"].b()); }
}
// Latency settings
diff --git a/game/webcam.cc b/game/webcam.cc
index e29ca66..aff3c8a 100644
--- a/game/webcam.cc
+++ b/game/webcam.cc
@@ -18,8 +18,14 @@ Webcam::Webcam(int cam_id):
// Initialize the capture device
m_capture = cvCaptureFromCAM(cam_id);
if (!m_capture) {
- std::cout << "Could not initialize webcam capturing!" << std::endl;
- return;
+ if (cam_id != -1) {
+ std::cout << "Webcam id " << cam_id << " failed, trying autodetecting...";
+ m_capture = cvCaptureFromCAM(-1);
+ }
+ if (!m_capture) {
+ std::cout << "Could not initialize webcam capturing!" << std::endl;
+ return;
+ }
}
// Initialize the video writer
#ifdef SAVE_WEBCAM_VIDEO
@@ -27,7 +33,7 @@ Webcam::Webcam(int cam_id):
int framew = cvGetCaptureProperty(m_capture, CV_CAP_PROP_FRAME_WIDTH);
int frameh = cvGetCaptureProperty(m_capture, CV_CAP_PROP_FRAME_HEIGHT);
int codec = CV_FOURCC('P','I','M','1'); // MPEG-1
- std::string out_file((getHomeDir() / std::string("/performous-webcam_out.mpg")).string());
+ std::string out_file((getHomeDir() / std::string("performous-webcam_out.mpg")).string());
m_writer = cvCreateVideoWriter(out_file.c_str(), codec, fps > 0 ? fps : 30.0f, cvSize(framew,frameh));
if (!m_writer) std::cout << "Could not initialize webcam video saving!" << std::endl;
#endif
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:58
|
Module: performous
Branch: joinmenu
Commit: b0fcbc2cd8865d3dfa8e4941be4ad55775fb3138
Author: Tapio Vierros <tap...@gm...>
Date: Wed Aug 11 18:30:33 2010 +0300
Whitespace.
---
game/fs.cc | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/game/fs.cc b/game/fs.cc
index c675e28..3a3dea5 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -49,20 +49,20 @@ fs::path getConfigDir() {
}
#else
{
- //open AppData directory
+ // Open AppData directory
std::string str;
ITEMIDLIST* pidl;
char AppDir[MAX_PATH];
HRESULT hRes = SHGetSpecialFolderLocation( NULL, CSIDL_APPDATA|CSIDL_FLAG_CREATE , &pidl );
if (hRes==NOERROR)
{
- SHGetPathFromIDList( pidl, AppDir );
- int i;
- for(i = 0; AppDir[i] != '\0'; i++){
- if(AppDir[i] == '\\') str += '/';
- else str += AppDir[i];
- }
- dir = fs::path(str) / "performous";
+ SHGetPathFromIDList( pidl, AppDir );
+ int i;
+ for (i = 0; AppDir[i] != '\0'; i++) {
+ if (AppDir[i] == '\\') str += '/';
+ else str += AppDir[i];
+ }
+ dir = fs::path(str) / "performous";
}
}
#endif
@@ -72,24 +72,24 @@ fs::path getConfigDir() {
fs::path getDataDir() {
#ifdef _WIN32
- return getConfigDir(); // APPDATA/performous
+ return getConfigDir(); // APPDATA/performous
#else
- fs::path shortDir = "performous";
- fs::path shareDir = SHARED_DATA_DIR;
- char const* xdg_data_home = getenv("XDG_DATA_HOME");
- // FIXME: Should this use "games" or not?
- return (xdg_data_home ? xdg_data_home / shortDir : getHomeDir() / ".local" / shareDir);
+ fs::path shortDir = "performous";
+ fs::path shareDir = SHARED_DATA_DIR;
+ char const* xdg_data_home = getenv("XDG_DATA_HOME");
+ // FIXME: Should this use "games" or not?
+ return (xdg_data_home ? xdg_data_home / shortDir : getHomeDir() / ".local" / shareDir);
#endif
}
fs::path getCacheDir() {
#ifdef _WIN32
- return getConfigDir() / "cache"; // APPDATA/performous
+ return getConfigDir() / "cache"; // APPDATA/performous
#else
- fs::path shortDir = "performous";
- char const* xdg_cache_home = getenv("XDG_CACHE_HOME");
- // FIXME: Should this use "games" or not?
- return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shortDir);
+ fs::path shortDir = "performous";
+ char const* xdg_cache_home = getenv("XDG_CACHE_HOME");
+ // FIXME: Should this use "games" or not?
+ return (xdg_cache_home ? xdg_cache_home / shortDir : getHomeDir() / ".cache" / shortDir);
#endif
}
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:56
|
Module: performous
Branch: joinmenu
Commit: b3f64eb7d0459bb8f4b1328c70f8934382096aec
Author: Tapio Vierros <tap...@gm...>
Date: Wed Aug 11 17:28:06 2010 +0300
Use cstdlib macros for program exit codes.
---
game/main.cc | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 508b965..bbc9f4c 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -349,7 +349,7 @@ int main(int argc, char** argv) try {
} catch (std::exception& e) {
std::cout << cmdline << std::endl;
std::cout << "ERROR: " << e.what() << std::endl;
- return 1;
+ return EXIT_FAILURE;
}
po::notify(vm);
@@ -360,11 +360,11 @@ int main(int argc, char** argv) try {
if (vm.count("version")) {
// Already printed the version string in the beginning...
- return 0;
+ return EXIT_SUCCESS;
}
if (vm.count("help")) {
std::cout << cmdline << " any arguments without a switch are interpreted as song folders.\n" << std::endl;
- return 0;
+ return EXIT_SUCCESS;
}
// Initialize audio for pdevhelp, michelp and the rest of the program
da::initialize libda;
@@ -381,7 +381,7 @@ int main(int argc, char** argv) try {
std::cout << boost::format(" %1% %|10t|%2%\n") % it->name() % it->desc();
}
std::cout << std::flush;
- return 0;
+ return EXIT_SUCCESS;
}
if (vm.count("michelp")) {
da::record::devlist_t l = da::record::devices();
@@ -398,7 +398,7 @@ int main(int argc, char** argv) try {
std::cout << boost::format(" %1% %|10t|%2%\n") % it->name() % it->desc();
}
std::cout << std::flush;
- return 0;
+ return EXIT_SUCCESS;
}
#ifdef USE_PORTMIDI
// Dump a list of MIDI input devices
@@ -420,15 +420,15 @@ int main(int argc, char** argv) try {
std::cout << std::endl << "Joystick utility - Touch your joystick to see buttons here" << std::endl
<< "Hit ESC (window focused) to quit" << std::endl << std::endl;
jstestLoop();
- return 0;
+ return EXIT_SUCCESS;
}
// Run the game init and main loop
mainLoop(songlist);
- return 0; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
+ return EXIT_SUCCESS; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
} catch (std::exception& e) {
std::cerr << "FATAL ERROR: " << e.what() << std::endl;
- return 1;
+ return EXIT_FAILURE;
}
void outputOptionalFeatureStatus() {
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:53
|
Module: performous
Branch: joinmenu
Commit: 1999fae70a8a51dd26e29578ff1fc708cecdb1fa
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Aug 11 11:39:06 2010 +0200
Tried to fix instrument forcing
---
game/joystick.hh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 31e0f30..bf83133 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -50,7 +50,7 @@ namespace input {
class InputDevPrivate {
public:
- InputDevPrivate(const Instrument &_instrument) : m_assigned(false), m_instrument(_instrument) {
+ InputDevPrivate(const Instrument _instrument) : m_assigned(false), m_instrument(_instrument) {
for(unsigned int i = 0 ; i < BUTTONS ; i++) {
m_pressed[i] = false;
}
@@ -97,7 +97,7 @@ namespace input {
std::deque<Event> m_events;
bool m_assigned;
bool m_pressed[BUTTONS];
- const Instrument &m_instrument;
+ Instrument m_instrument;
};
typedef std::map<unsigned int,InputDevPrivate> InputDevs;
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:51
|
Module: performous Branch: joinmenu Commit: bd194e7f84cb3b97e969b34937e10cd65dc8608b Author: Vincent Le Ligeour <yo...@us...> Date: Tue Aug 10 15:42:17 2010 +0200 Added default GH5/Band Hero controller matching --- data/controllers.xml | 27 +++++++++++++++++++++++++++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/data/controllers.xml b/data/controllers.xml index ab48239..a3f271e 100644 --- a/data/controllers.xml +++ b/data/controllers.xml @@ -14,6 +14,19 @@ <button id="9" value="start" /> </mapping> </controller> + <controller type="guitar" name="GUITAR_GUITARHERO5"> + <description>Guitar Hero 5/Band Hero guitar</description> + <regexp match="Entertainment Guitar Hero5" /> + <mapping> + <button id="0" value="yellow" /> + <button id="1" value="green" /> + <button id="2" value="red" /> + <button id="3" value="blue" /> + <button id="4" value="orange" /> + <button id="8" value="select" /> + <button id="9" value="start" /> + </mapping> + </controller> <controller type="guitar" name="GUITAR_GUITARHERO_XPLORER"> <description>Guitar Hero X-plorer guitar</description> <regexp match="Guitar Hero X-plorer" /> @@ -82,6 +95,20 @@ <button id="9" value="start" /> </mapping> </controller> + <controller type="drumkit" name="DRUMS_GUITARHERO5"> + <description>Guitar Hero 5/Band Hero drum kit</description> + <regexp match="Drum Guitar Hero5" /> + <mapping> + <button id="0" value="blue" /> + <button id="1" value="green" /> + <button id="2" value="red" /> + <button id="3" value="yellow" /> + <button id="4" value="kick" /> + <button id="5" value="green" /> + <button id="8" value="select" /> + <button id="9" value="start" /> + </mapping> + </controller> <controller type="drumkit" name="DRUMS_ROCKBAND_WII"> <description>RockBand Wii drum kit</description> <regexp match="Harmonix Drum Controller for Nintendo Wii" /> |
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:51
|
Module: performous
Branch: joinmenu
Commit: 24f7f95e632d8bcb5d0ad2cad03ba1e860155780
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Aug 10 13:46:45 2010 +0200
Fixed instrument forcing
---
game/joystick.cc | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 35955d5..d52b85c 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -350,26 +350,28 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
void input::SDL::init() {
readControllers(g_instruments, getDefaultConfig(fs::path("/config/controllers.xml")));
readControllers(g_instruments, getConfigDir() / "controllers.xml");
- unsigned int sdl_id;
- std::string instrument_type;
std::map<unsigned int, input::Instrument> forced_type;
- std::string regexp_match_force("^[0-9]+:\\(");
+ std::string regexp_match_force("^([0-9]+):(\\(");
for(input::Instruments::iterator it = g_instruments.begin() ; it != g_instruments.end() ; ++it) {
if(it == g_instruments.begin())
regexp_match_force += it->first;
else
regexp_match_force += "|" + it->first;
}
- regexp_match_force += "\\)$";
+ regexp_match_force += "\\))$";
boost::regex match_force(regexp_match_force);
+ boost::match_results<const char*> what;
ConfigItem::StringList const& instruments = config["game/instruments"].sl();
for (ConfigItem::StringList::const_iterator it = instruments.begin(); it != instruments.end(); ++it) {
- if (!regex_search(it->c_str(), match_force)) {
+ if (!regex_search(it->c_str(), what, match_force)) {
std::cerr << "Error \"" << *it << "\" is not a valid instrument forced value" << std::endl;
continue;
} else {
+ unsigned int sdl_id = boost::lexical_cast<unsigned int>(what[1]);
+ std::string instrument_type(what[2]);
+
for(input::Instruments::const_iterator it2 = g_instruments.begin() ; it2 != g_instruments.end() ; ++it2) {
if(instrument_type == it2->first) {
forced_type.insert(std::pair<unsigned int,input::Instrument>(sdl_id, input::Instrument(it2->second)));
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:46
|
Module: performous
Branch: joinmenu
Commit: cef3cd7b668b04579c81ca0b681da81b79403b6f
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Aug 10 12:20:13 2010 +0200
Removed boost::spirit matching by boost::regex for instrument forcing
---
game/joystick.cc | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index ead308d..35955d5 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -216,7 +216,6 @@ void input::SDL::init_devices() {
}
}
-#include <boost/spirit/include/classic_core.hpp>
#include "fs.hh"
#include <libxml++/libxml++.h>
@@ -355,19 +354,19 @@ void input::SDL::init() {
std::string instrument_type;
std::map<unsigned int, input::Instrument> forced_type;
- using namespace boost::spirit::classic;
- rule<> type;
- for(input::Instruments::const_iterator it = g_instruments.begin() ; it != g_instruments.end() ; ++it) {
+ std::string regexp_match_force("^[0-9]+:\\(");
+ for(input::Instruments::iterator it = g_instruments.begin() ; it != g_instruments.end() ; ++it) {
if(it == g_instruments.begin())
- type = str_p(it->first.c_str());
+ regexp_match_force += it->first;
else
- type = type | it->first.c_str();
+ regexp_match_force += "|" + it->first;
}
- rule<> entry = uint_p[assign_a(sdl_id)] >> ":" >> (type)[assign_a(instrument_type)];
+ regexp_match_force += "\\)$";
+ boost::regex match_force(regexp_match_force);
ConfigItem::StringList const& instruments = config["game/instruments"].sl();
for (ConfigItem::StringList::const_iterator it = instruments.begin(); it != instruments.end(); ++it) {
- if (!parse(it->c_str(), entry).full) {
+ if (!regex_search(it->c_str(), match_force)) {
std::cerr << "Error \"" << *it << "\" is not a valid instrument forced value" << std::endl;
continue;
} else {
@@ -403,7 +402,6 @@ void input::SDL::init() {
bool found = false;
for(input::Instruments::const_iterator it = g_instruments.begin() ; it != g_instruments.end() ; ++it) {
boost::regex sdl_name(it->second.match);
- boost::cmatch match;
if (regex_search(name.c_str(), sdl_name)) {
std::cout << " Detected as: " << it->second.description << std::endl;
input::detail::devices.insert(std::make_pair<unsigned int, input::detail::InputDevPrivate>(i, input::detail::InputDevPrivate(it->second)));
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:44
|
Module: performous
Branch: joinmenu
Commit: 8ca419202a8538f3c1a4fcc4f5f83d61ca2087bb
Author: Tapio Vierros <tap...@gm...>
Date: Mon Aug 9 23:41:11 2010 +0300
Rework audio sync correction.
* Fixes the dreadful pause bug
* Gives quite fluent experience for me on Windows (and Linux)
* Needs testing and auditing
---
game/audio.hh | 42 ++++++++++++++++++++++++------------------
1 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/game/audio.hh b/game/audio.hh
index e4f701f..77e76cc 100644
--- a/game/audio.hh
+++ b/game/audio.hh
@@ -22,7 +22,8 @@ struct Stream {
double fade; ///< Fade level
/// constructor
Stream(std::string const& filename, unsigned int sr):
- mpeg(false, true, filename, sr), srate(sr), fade(1.0), m_time(getTime()), m_syncTime(m_time), m_correction(), m_pos() {}
+ mpeg(false, true, filename, sr), srate(sr), fade(1.0),
+ m_syncTime(getTime()), m_baseTime(m_syncTime), m_basePosition(0), m_pos() {}
/// crossfades songs
bool operator()(da::pcm_data& data) {
timeSync(); // Keep audio synced
@@ -42,10 +43,10 @@ struct Stream {
/// Get current position in seconds (with corrections applied)
double pos() const {
boost::posix_time::ptime now = getTime();
- double delay = seconds(now - m_syncTime); // Since last sync
- // If more than 100 ms since last sync, freeze time to m_syncTime instead of realtime
- // In either case, return the clock + correction
- return seconds((delay > 0.1 ? m_syncTime : now) - m_time) + m_correction;
+ const double syncDelay = seconds(now - m_syncTime); // Since last audio buffer
+ const double baseDelay = seconds(now - m_baseTime); // Since last time base
+ // If more than 100 ms since last sync, freeze time (audio is paused)
+ return (syncDelay > 0.1 ? pos_internal() : m_basePosition + baseDelay);
}
double duration() const { return mpeg.audioQueue.duration(); }
bool eof() const { return mpeg.audioQueue.eof(m_pos); }
@@ -53,25 +54,30 @@ private:
static boost::posix_time::ptime getTime() { return boost::posix_time::microsec_clock::universal_time(); }
double pos_internal() const { return double(m_pos) / srate / 2.0; }
double seconds(boost::posix_time::time_duration const& d) const { return 1e-6 * d.total_microseconds(); }
- /// Adjust sync, duration of the audio
+ /**
+ * Adjust sync, duration of the audio.
+ * This works by using mostly system time and
+ * syncing it with the audio time every few seconds
+ * (or when something out-of-the-ordinary happens).
+ */
void timeSync() {
boost::posix_time::ptime now = getTime();
- double t = seconds(now - m_time) + m_correction;
- double duration = seconds(now - m_syncTime);
- double diff = t - pos_internal();
+ const double syncDelay = seconds(now - m_syncTime); // Since last audio buffer
+ const double baseDelay = seconds(now - m_baseTime); // Since last time base
+ const double delay = std::abs(pos() - pos_internal()); // Prediction difference
m_syncTime = now;
- if (duration < 0.0 || duration > 1.0) return; // No syncing for weird situations
- if (std::abs(diff) < 0.1 * duration) {
- // Apply 5 % adjustment either up or down
- m_correction += (diff > 0.0 ? -1.0 : 1.0) * 0.05 * duration;
- } else {
- // Stepped adjustment to the right time (e.g. after seeking)
- m_correction -= diff;
+ // Time to create new reference time?
+ // 1. We haven't recieved any audio frames for a while (maybe audio was paused)
+ // 2. Time has been running free for several seconds (so let's sync every once in a while)
+ // 3. Prediction is radically different from last buffer time (due to e.g. seeking)
+ if (syncDelay > 0.1 || baseDelay > 5.0 || delay > 0.2) {
+ m_baseTime = now;
+ m_basePosition = pos_internal();
}
}
- boost::posix_time::ptime m_time; ///< The base time (time at the beginning)
boost::posix_time::ptime m_syncTime; ///< Time of the previous audio timeSync
- double m_correction; ///< Offset added to system time to get audio time
+ boost::posix_time::ptime m_baseTime; ///< A reference time
+ double m_basePosition; ///< Position at the base time
int64_t m_pos; ///< Current sample position
};
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:41
|
Module: performous Branch: joinmenu Commit: e4c3b8398946ef96772bbac39061ae0db7c068f8 Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 9 23:31:11 2010 +0300 Fix typo in cross-compilation script. --- win32/mingw-cross-env/make-deps.sh | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/win32/mingw-cross-env/make-deps.sh b/win32/mingw-cross-env/make-deps.sh index c2554e2..a91f727 100755 --- a/win32/mingw-cross-env/make-deps.sh +++ b/win32/mingw-cross-env/make-deps.sh @@ -27,7 +27,7 @@ echo "Make gcc" make gcc echo "Make deps" -make zlib libpng jpeg glew freeglutnsdl boost atk cairo fontconfig freetype gettext glib gtk libcroco libgsf libiconv librsvg libxml2 pango pixman portaudio libsigc++ libglibmm libxml++ liborc libschroedinger +make zlib libpng jpeg glew freeglut sdl boost atk cairo fontconfig freetype gettext glib gtk libcroco libgsf libiconv librsvg libxml2 pango pixman portaudio libsigc++ glibmm libxml++ liborc libschroedinger echo "Make ffmpeg from SVN" TARGET=i686-pc-mingw32 |
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:39
|
Module: performous
Branch: joinmenu
Commit: 5fc70148025807ed00ac145711cfe5952ded7a91
Author: Tapio Vierros <tap...@gm...>
Date: Mon Aug 9 18:57:53 2010 +0300
Return 1 when exiting main() with fatal error.
---
game/main.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 8eaec03..508b965 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -428,6 +428,7 @@ int main(int argc, char** argv) try {
return 0; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
} catch (std::exception& e) {
std::cerr << "FATAL ERROR: " << e.what() << std::endl;
+ return 1;
}
void outputOptionalFeatureStatus() {
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:36
|
Module: performous Branch: joinmenu Commit: 568c57316d70c5536e2699b687c65fdfaf0651b4 Author: Tapio Vierros <tap...@gm...> Date: Mon Aug 9 00:04:23 2010 +0300 WIP cross-compilation scripts for Win32 using mingw-cross-env. --- win32/mingw-cross-env/README | 14 +++++++ win32/mingw-cross-env/make-deps.sh | 51 +++++++++++++++++++++++++++ win32/mingw-cross-env/mk/glibmm.mk | 35 ++++++++++++++++++ win32/mingw-cross-env/mk/liborc.mk | 29 +++++++++++++++ win32/mingw-cross-env/mk/libschroedinger.mk | 29 +++++++++++++++ win32/mingw-cross-env/mk/libsigc++.mk | 35 ++++++++++++++++++ win32/mingw-cross-env/mk/libxml++.mk | 33 +++++++++++++++++ 7 files changed, 226 insertions(+), 0 deletions(-) diff --git a/win32/mingw-cross-env/README b/win32/mingw-cross-env/README new file mode 100644 index 0000000..dc6f5ae --- /dev/null +++ b/win32/mingw-cross-env/README @@ -0,0 +1,14 @@ +Cross-compiling Performous and dependencies using mingw-cross-env +================================================================= + +This is WIP. + +"Mingw cross compiling environment" http://mingw-cross-env.nongnu.org/ provides makefile scripts to download and compile a recent version of gcc cross-compiler and a good amount of additional libraries. Not all of Performous' dependencies are in, but most are and the rest have scripts here. + +Use the make-deps.sh script to build the dependencies. Note that it builds a bit more stuff than is strictly required but well just need to live with it. It also builds static libraries, not shared ones. + +Note: you could maybe try just building the compiler with this and then try the cross-from-debian scripts with the compiler variables pointing to this, newer mingw. + +TODO: Add make-performous.sh script, that creates the needed Toolchain.cmake file and does the manual linking + + diff --git a/win32/mingw-cross-env/make-deps.sh b/win32/mingw-cross-env/make-deps.sh new file mode 100755 index 0000000..c2554e2 --- /dev/null +++ b/win32/mingw-cross-env/make-deps.sh @@ -0,0 +1,51 @@ +#!/bin/bash -e + +if [ ! "$1" ]; then + echo "Usage: $0 prefix-path" + exit 1 +fi + +prefix="$1" + +# Create the prefix path and copy our own suplementary scripts +mkdir -p "$prefix/src" +cp mk/*.mk "$prefix/src" + +# Download the cross env if needed +if [ ! -f "$prefix/Makefile" ]; then + crossenvpackage=mingw-cross-env-2.15 + cd /tmp + wget http://download.savannah.nongnu.org/releases/mingw-cross-env/$crossenvpackage.tar.gz + tar zxf $crossenvpackage.tar.gz + cp -r $crossenvpackage/* "$prefix" + rm -rf $crossenvpackage +fi + +cd "$prefix" + +echo "Make gcc" +make gcc + +echo "Make deps" +make zlib libpng jpeg glew freeglutnsdl boost atk cairo fontconfig freetype gettext glib gtk libcroco libgsf libiconv librsvg libxml2 pango pixman portaudio libsigc++ libglibmm libxml++ liborc libschroedinger + +echo "Make ffmpeg from SVN" +TARGET=i686-pc-mingw32 +export PATH="$prefix/usr/bin:$PATH" +export PKG_CONFIG_PATH=$prefix/usr/i686-pc-mingw32/lib/pkgconfig/ + +# Checkout / update from svn +if [ ! -d ffmpeg ]; then + svn co svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg +else + svn up ffmpeg +fi + +cd ffmpeg + ./configure --prefix="$prefix/usr/$TARGET" --enable-cross-compile --cross-prefix="$TARGET-" --target-os=mingw32 --arch=i386 --disable-shared --enable-static --enable-gpl --enable-postproc --enable-w32threads --enable-runtime-cpudetect --enable-memalign-hack --enable-zlib --enable-libschroedinger --disable-muxers --disable-encoders --disable-ffserver --disable-ffplay --disable-protocol=http --disable-protocol=rtp --disable-protocol=tcp --disable-protocol=udp --extra-cflags="-I$prefix/usr/$TARGET/include" --extra-ldflags="-L$prefix/usr/$TARGET/lib" + sed -i -e 's/-Werror=[^ ]*//g' config.mak + make -j2 + make install +cd .. + +echo "All done" diff --git a/win32/mingw-cross-env/mk/glibmm.mk b/win32/mingw-cross-env/mk/glibmm.mk new file mode 100644 index 0000000..2ebb304 --- /dev/null +++ b/win32/mingw-cross-env/mk/glibmm.mk @@ -0,0 +1,35 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# GLibmm +PKG := glibmm +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.24.2 +$(PKG)_CHECKSUM := df5f22d2c40ebdf097ecdb4a7dfeef70d1ca24e7 +$(PKG)_SUBDIR := glibmm-$($(PKG)_VERSION) +$(PKG)_FILE := glibmm-$($(PKG)_VERSION).tar.bz2 +$(PKG)_WEBSITE := http://www.gtkmm.org/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/glibmm/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := glib + +define $(PKG)_UPDATE + wget -q -O- 'http://git.gnome.org/browse/glibmm/refs/tags' | \ + grep '<a href=' | \ + $(SED) -n 's,.*<a[^>]*>glibmm-*\([0-9][^<]*\)<.*,\1,p' | \ + grep -v '^2\.24\.' | \ + head -1 +endef + +define $(PKG)_BUILD + # cross build + # wine confuses the cross-compiling detection, so set it explicitly + $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' \ + --with-threads=win32 \ + CXX='$(TARGET)-c++' \ + PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff --git a/win32/mingw-cross-env/mk/liborc.mk b/win32/mingw-cross-env/mk/liborc.mk new file mode 100644 index 0000000..f3cf9a6 --- /dev/null +++ b/win32/mingw-cross-env/mk/liborc.mk @@ -0,0 +1,29 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# liborc +PKG := liborc +$(PKG)_IGNORE := +$(PKG)_VERSION := 0.4.5 +$(PKG)_CHECKSUM := e24d485093a5e5412b4917e4d89ecd89fad3721b +$(PKG)_SUBDIR := orc-$($(PKG)_VERSION) +$(PKG)_FILE := orc-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://code.entropywave.com/ +$(PKG)_URL := http://code.entropywave.com/download/orc/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef diff --git a/win32/mingw-cross-env/mk/libschroedinger.mk b/win32/mingw-cross-env/mk/libschroedinger.mk new file mode 100644 index 0000000..62506d5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libschroedinger.mk @@ -0,0 +1,29 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# libschroedinger +PKG := libschroedinger +$(PKG)_IGNORE := +$(PKG)_VERSION := 1.0.9 +$(PKG)_CHECKSUM := b4121e10cc474c97676e03ae49c5a91c11956ba0 +$(PKG)_SUBDIR := schroedinger-$($(PKG)_VERSION) +$(PKG)_FILE := schroedinger-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://diracvideo.org/ +$(PKG)_URL := http://diracvideo.org/download/schroedinger/$($(PKG)_FILE) +$(PKG)_DEPS := gcc liborc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef diff --git a/win32/mingw-cross-env/mk/libsigc++.mk b/win32/mingw-cross-env/mk/libsigc++.mk new file mode 100644 index 0000000..27e20e5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libsigc++.mk @@ -0,0 +1,35 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# GLib +PKG := libsigc++ +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.2.8 +$(PKG)_CHECKSUM := c26f57110629c16c0b5a873346b7c1cf0edc9c5e +$(PKG)_SUBDIR := libsigc++-$($(PKG)_VERSION) +$(PKG)_FILE := libsigc++-$($(PKG)_VERSION).tar.bz2 +$(PKG)_WEBSITE := http://libsigc.sourceforge.net/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/libsigc++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + wget -q -O- 'http://FIXME' | \ + grep '<a href=' | \ + $(SED) -n 's,.*<a[^>]*>libsigc++-*\([0-9][^<]*\)<.*,\1,p' | \ + grep -v '^2\.24\.' | \ + head -1 +endef + +define $(PKG)_BUILD + # cross build + # wine confuses the cross-compiling detection, so set it explicitly + $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/configure' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' \ + --with-threads=win32 \ + CXX='$(TARGET)-c++' \ + PKG_CONFIG='$(PREFIX)/bin/$(TARGET)-pkg-config' + $(MAKE) -C '$(1)' -j '$(JOBS)' install +endef diff --git a/win32/mingw-cross-env/mk/libxml++.mk b/win32/mingw-cross-env/mk/libxml++.mk new file mode 100644 index 0000000..4ff81d5 --- /dev/null +++ b/win32/mingw-cross-env/mk/libxml++.mk @@ -0,0 +1,33 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +# libxml++ +PKG := libxml++ +$(PKG)_IGNORE := +$(PKG)_VERSION := 2.30.1 +$(PKG)_CHECKSUM := 0fc6fc14c4751754037beb46f387fa7d069fe2c9 +$(PKG)_SUBDIR := libxml++-$($(PKG)_VERSION) +$(PKG)_FILE := libxml++-$($(PKG)_VERSION).tar.gz +$(PKG)_WEBSITE := http://libxmlplusplus.sourceforge.net/ +$(PKG)_URL := http://ftp.gnome.org/pub/GNOME/sources/libxml++/$(call SHORT_PKG_VERSION,$(PKG))/$($(PKG)_FILE) +$(PKG)_DEPS := libxml2 glibmm + +define $(PKG)_UPDATE + wget -q -O- 'http://git.gnome.org/browse/libxml++/refs/tags' | \ + grep '<a href=' | \ + $(SED) -n "s,.*<a href='[^']*/tag/?id=v\\([0-9][^']*\\)'.*,\\1,p" | \ + head -1 +endef + +define $(PKG)_BUILD + #$(SED) -i 's,`uname`,MinGW,g' '$(1)/xml2-config.in' + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --disable-shared \ + --without-debug \ + --prefix='$(PREFIX)/$(TARGET)' \ + --without-python \ + --without-threads + $(MAKE) -C '$(1)' -j '$(JOBS)' bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= + $(MAKE) -C '$(1)' -j 1 install bin_PROGRAMS= sbin_PROGRAMS= noinst_PROGRAMS= +endef |
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:34
|
Module: performous
Branch: joinmenu
Commit: c248ca972d5565c50ce2626671a6d377b59ce328
Author: Tapio Vierros <tap...@gm...>
Date: Sun Aug 8 23:18:12 2010 +0300
Whitespace.
---
libs/plugin++/include/plugin++/dll.hpp | 38 ++++++++++----------
libs/plugin++/include/plugin++/loader.hpp | 18 +++++-----
libs/plugin++/src/loader.cc | 54 ++++++++++++++--------------
3 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/libs/plugin++/include/plugin++/dll.hpp b/libs/plugin++/include/plugin++/dll.hpp
index 51de65e..4c3d0cf 100644
--- a/libs/plugin++/include/plugin++/dll.hpp
+++ b/libs/plugin++/include/plugin++/dll.hpp
@@ -15,25 +15,25 @@ namespace plugin {
dll_error(std::string const& msg): runtime_error(msg) {}
};
- /// \brief Dynamic library loader
- class Plugin_API dll {
- void* lib;
- public:
- /// Open a dynamic library
- /// \throws dll_error if the library cannot be loaded
- dll(std::string const& filename);
- ~dll();
- /// Get a symbol from DLL (symptr can be a data or a function pointer)
- /// \throws dll_error if no symbol is found
- template <typename SymPtr> void sym(std::string const& name, SymPtr& symptr) {
- union { void* ptr; SymPtr symptr; } conv; // Data/function conversion without warnings
- conv.ptr = sym(name.c_str());
- if (!conv.ptr) throw dll_error("Symbol " + name + " not found");
- symptr = conv.symptr;
- }
- /// Get a symbol from DLL (low level C style version)
- void* sym(char const* name);
- };
+ /// \brief Dynamic library loader
+ class Plugin_API dll {
+ void* lib;
+ public:
+ /// Open a dynamic library
+ /// \throws dll_error if the library cannot be loaded
+ dll(std::string const& filename);
+ ~dll();
+ /// Get a symbol from DLL (symptr can be a data or a function pointer)
+ /// \throws dll_error if no symbol is found
+ template <typename SymPtr> void sym(std::string const& name, SymPtr& symptr) {
+ union { void* ptr; SymPtr symptr; } conv; // Data/function conversion without warnings
+ conv.ptr = sym(name.c_str());
+ if (!conv.ptr) throw dll_error("Symbol " + name + " not found");
+ symptr = conv.symptr;
+ }
+ /// Get a symbol from DLL (low level C style version)
+ void* sym(char const* name);
+ };
}
#endif
diff --git a/libs/plugin++/include/plugin++/loader.hpp b/libs/plugin++/include/plugin++/loader.hpp
index 4463cf6..d33084d 100644
--- a/libs/plugin++/include/plugin++/loader.hpp
+++ b/libs/plugin++/include/plugin++/loader.hpp
@@ -8,16 +8,16 @@
#include <boost/ptr_container/ptr_vector.hpp>
namespace plugin {
- namespace fs = boost::filesystem;
+ namespace fs = boost::filesystem;
- /** @short A helper for loading all matching libraries in a folder. **/
- class loader {
- boost::ptr_vector<dll> dlls;
- void parse(std::set<fs::path>& paths, char const* var, fs::path const& folder = fs::path());
- void load(fs::path const& path);
- public:
- loader(fs::path const& folder);
- };
+ /** @short A helper for loading all matching libraries in a folder. **/
+ class loader {
+ boost::ptr_vector<dll> dlls;
+ void parse(std::set<fs::path>& paths, char const* var, fs::path const& folder = fs::path());
+ void load(fs::path const& path);
+ public:
+ loader(fs::path const& folder);
+ };
}
#endif
diff --git a/libs/plugin++/src/loader.cc b/libs/plugin++/src/loader.cc
index a21ea30..078c4cf 100644
--- a/libs/plugin++/src/loader.cc
+++ b/libs/plugin++/src/loader.cc
@@ -23,33 +23,33 @@ namespace fs = boost::filesystem;
/// Break var (a delimited path string) into paths (appends folder if supplied).
void loader::parse(std::set<fs::path>& paths, char const* var, fs::path const& folder) {
- if (!var) return;
- std::istringstream iss(var);
- std::string elem;
- while (std::getline(iss, elem, PATHSEP)) {
- fs::path p = elem;
- if (!folder.empty()) p /= folder;
- if (fs::is_directory(p)) paths.insert(p);
- }
+ if (!var) return;
+ std::istringstream iss(var);
+ std::string elem;
+ while (std::getline(iss, elem, PATHSEP)) {
+ fs::path p = elem;
+ if (!folder.empty()) p /= folder;
+ if (fs::is_directory(p)) paths.insert(p);
+ }
}
/// Try to load all libraries in the given folder.
void loader::load(fs::path const& path) {
- for (fs::directory_iterator it(path), end; it != end; ++it) {
- try {
- dlls.push_back(new dll(it->string()));
- } catch (std::runtime_error const& e) {
- std::cerr << e.what() << std::endl;
- }
- }
+ for (fs::directory_iterator it(path), end; it != end; ++it) {
+ try {
+ dlls.push_back(new dll(it->string()));
+ } catch (std::runtime_error const& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ }
}
loader::loader(fs::path const& folder) {
- std::set<fs::path> paths;
- // Try PLUGIN_PATH environment setting
- parse(paths, std::getenv("PLUGIN_PATH"));
- // Try other options only if folder was given
- if (!folder.empty()) {
+ std::set<fs::path> paths;
+ // Try PLUGIN_PATH environment setting
+ parse(paths, std::getenv("PLUGIN_PATH"));
+ // Try other options only if folder was given
+ if (!folder.empty()) {
// Try relative path from executable
fs::path p = execname();
p = p.parent_path().parent_path();
@@ -58,17 +58,17 @@ loader::loader(fs::path const& folder) {
if (fs::is_directory(p)) paths.insert(p);
}
#ifndef _WIN32
- // Try UNIX library paths
- parse(paths, std::getenv("LD_LIBRARY_PATH"), folder);
- parse(paths, UNIX_LIBPATH, folder);
+ // Try UNIX library paths
+ parse(paths, std::getenv("LD_LIBRARY_PATH"), folder);
+ parse(paths, UNIX_LIBPATH, folder);
#endif
- }
- // Load the contents of each folder
- for (std::set<fs::path>::const_iterator it = paths.begin(); it != paths.end(); ++it) load(*it);
+ }
+ // Load the contents of each folder
+ for (std::set<fs::path>::const_iterator it = paths.begin(); it != paths.end(); ++it) load(*it);
#ifndef _WIN32
// HACK: ifdeffing this message out since it would be consfusing on Windows,
// where PortAudio is built into libda (and thus no plugins used).
- if (dlls.empty()) std::cerr << "No plugins found. Try setting PLUGIN_PATH to the folder with the plugins." << std::endl;
+ if (dlls.empty()) std::cerr << "No plugins found. Try setting PLUGIN_PATH to the folder with the plugins." << std::endl;
#endif
}
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:31
|
Module: performous
Branch: joinmenu
Commit: 26c3c2f97540bb7397fc76b82f2ef5dba94dc39a
Author: Tapio Vierros <tap...@gm...>
Date: Sun Aug 8 23:15:57 2010 +0300
Hack to get rid of confusing error message on Windows.
---
libs/plugin++/src/loader.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libs/plugin++/src/loader.cc b/libs/plugin++/src/loader.cc
index c7bdb4c..a21ea30 100644
--- a/libs/plugin++/src/loader.cc
+++ b/libs/plugin++/src/loader.cc
@@ -65,6 +65,10 @@ loader::loader(fs::path const& folder) {
}
// Load the contents of each folder
for (std::set<fs::path>::const_iterator it = paths.begin(); it != paths.end(); ++it) load(*it);
+#ifndef _WIN32
+ // HACK: ifdeffing this message out since it would be consfusing on Windows,
+ // where PortAudio is built into libda (and thus no plugins used).
if (dlls.empty()) std::cerr << "No plugins found. Try setting PLUGIN_PATH to the folder with the plugins." << std::endl;
-}
+#endif
+}
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:29
|
Module: performous
Branch: joinmenu
Commit: d8ec1b4a943d9598fa3a302a5253bb95d5c4a258
Author: Fredrik Klasson <fr...@li...>
Date: Sun Aug 8 20:36:14 2010 +0200
[-] Removing left-over debug code
---
game/filemagic.hh | 11 -----------
1 files changed, 0 insertions(+), 11 deletions(-)
diff --git a/game/filemagic.hh b/game/filemagic.hh
index ccc9067..3f8b00b 100644
--- a/game/filemagic.hh
+++ b/game/filemagic.hh
@@ -76,17 +76,6 @@ namespace filemagic {
//std::for_each(ext.begin(), ext.end(), static_cast<int(*)(int)>(std::tolower));
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower );
-# ifndef NDEBUG
- std::string f_ext = filename.extension();
- std::for_each(f_ext.begin(), f_ext.end(), static_cast<int(*)(int)>(std::tolower));
-
- std::string t_ext = filename.extension();
- std::transform(t_ext.begin(), t_ext.end(), t_ext.begin(), ::tolower );
-
- if(t_ext != f_ext)
- std::clog << "Nope: \"" << t_ext << "\" != \"" << f_ext << "\"" << std::endl;
-# endif
-
return ext == ".svg" /* || signaturePrefix<1>(filename, {'<') */;
}
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:25
|
Module: performous
Branch: joinmenu
Commit: 679a6acef163b8707084864246f63e9b15ffd1b3
Author: Fredrik Klasson <fr...@li...>
Date: Sun Aug 8 12:51:57 2010 +0200
[ ] Replacing a few std::cout with std::clog. I think those are verbose messages, thus only show up when asked for.
---
game/audio.cc | 2 +-
game/backgrounds.cc | 8 ++++----
game/color.cc | 2 +-
game/configuration.cc | 6 +++---
game/fs.cc | 4 ++--
game/main.cc | 14 +++++++++-----
game/midifile.cc | 2 +-
game/songparser-ini.cc | 2 +-
game/songparser-txt.cc | 2 +-
game/songs.cc | 2 +-
game/unicode.cc | 2 +-
11 files changed, 25 insertions(+), 21 deletions(-)
diff --git a/game/audio.cc b/game/audio.cc
index ae4acfb..fe8f236 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -28,7 +28,7 @@ void Audio::open(std::string const& pdev, std::size_t rate, std::size_t frames)
.set_channels(2)
.set_rate(rate)
.set_frames(frames)
- .set_debug(std::cerr);
+ .set_debug(std::clog);
m_mixer.start(m_rs);
}
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 5fe42bd..fe2ea08 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -29,12 +29,12 @@ void Backgrounds::reload_internal() {
Paths paths = getPaths();
for (Paths::iterator it = paths.begin(); m_loading && it != paths.end(); ++it) {
*it /= "backgrounds";
- if (!fs::is_directory(*it)) { std::cout << ">>> Not scanning for backgrounds: " << *it << " (no such directory)" << std::endl; continue; }
- std::cout << ">>> Scanning " << *it << " (for backgrounds)" << std::endl;
+ if (!fs::is_directory(*it)) { std::clog << ">>> Not scanning for backgrounds: " << *it << " (no such directory)" << std::endl; continue; }
+ std::clog << ">>> Scanning " << *it << " (for backgrounds)" << std::endl;
size_t count = m_bgs.size();
reload_internal(*it); // Scan the found folder
size_t diff = m_bgs.size() - count;
- if (diff > 0 && m_loading) std::cout << diff << " backgrounds loaded" << std::endl;
+ if (diff > 0 && m_loading) std::clog << diff << " backgrounds loaded" << std::endl;
}
m_loading = false;
{ // Randomize the order
@@ -47,7 +47,7 @@ void Backgrounds::reload_internal() {
void Backgrounds::reload_internal(fs::path const& parent) {
namespace fs = fs;
- if (std::distance(parent.begin(), parent.end()) > 20) { std::cout << ">>> Not scanning: " << parent.string() << " (maximum depth reached, possibly due to cyclic symlinks)" << std::endl; return; }
+ if (std::distance(parent.begin(), parent.end()) > 20) { std::clog << ">>> Not scanning: " << parent.string() << " (maximum depth reached, possibly due to cyclic symlinks)" << std::endl; return; }
try {
// Find suitable file formats
boost::regex expression("(.*\\.(png|jpeg|jpg|svg))$", boost::regex_constants::icase);
diff --git a/game/color.cc b/game/color.cc
index 09702f0..f5da032 100644
--- a/game/color.cc
+++ b/game/color.cc
@@ -37,7 +37,7 @@ Color::Color(std::string const& str) {
}
ColorNames::Map::const_iterator it = colors.m.find(str);
if (it != colors.m.end()) { *this = it->second; return; }
- std::cerr << "WARNING: Unknown color: " << str << " (using magenta to hilight)" << std::endl;
+ std::clog << "WARNING: Unknown color: " << str << " (using magenta to hilight)" << std::endl;
*this = Color(1.0, 0.0, 1.0);
}
diff --git a/game/configuration.cc b/game/configuration.cc
index f108d4b..6391941 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -262,10 +262,10 @@ void readMenuXML(xmlpp::Node* node) {
void readConfigXML(fs::path const& file, int mode) {
if (!fs::exists(file)) {
- std::cout << "Skipping " << file << " (not found)" << std::endl;
+ std::clog << "Skipping " << file << " (not found)" << std::endl;
return;
}
- std::cout << "Parsing " << file << std::endl;
+ std::clog << "Parsing " << file << std::endl;
xmlpp::DomParser domParser(file.string());
try {
xmlpp::NodeSet n = domParser.get_document()->get_root_node()->find("/performous/menu/entry");
@@ -293,7 +293,7 @@ void readConfigXML(fs::path const& file, int mode) {
}
} else {
if (it == config.end()) {
- std::cout << " Entry " << name << " ignored (does not exist in config schema)." << std::endl;
+ std::clog << " Entry " << name << " ignored (does not exist in config schema)." << std::endl;
continue;
}
it->second.update(elem, mode);
diff --git a/game/fs.cc b/game/fs.cc
index a40c545..c675e28 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -132,10 +132,10 @@ bool isThemeResource(fs::path filename){
namespace {
bool pathNotExist(fs::path const& p) {
if (exists(p)) {
- std::cout << ">>> Using data path \"" << p.string() << "\"" << std::endl;
+ std::clog << ">>> Using data path \"" << p.string() << "\"" << std::endl;
return false;
}
- std::cout << ">>> Not using \"" << p.string() << "\" (does not exist)" << std::endl;
+ std::clog << ">>> Not using \"" << p.string() << "\" (does not exist)" << std::endl;
return true;
}
}
diff --git a/game/main.cc b/game/main.cc
index 44fab76..8eaec03 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -39,6 +39,8 @@ bool g_verbose_messages = false;
class VerboseMessageSink : public boost::iostreams::sink {
public:
+ // i.e. make clog like cout, but only if g_verbose_messages is set.
+ // (we could use cerr or any other file if we want)
std::streamsize write(const char* s, std::streamsize n) {
if(g_verbose_messages)
for(std::streamsize i=0; i<n; i++)
@@ -56,6 +58,7 @@ VerboseMessageSink vsm;
static void signalSetup();
extern "C" void quit(int) {
+// shouldn't "not EXIT_SUCCESS" be sent - ^C^C is an abort, not normal termination?
if (g_quit) std::exit(EXIT_SUCCESS); // Instant exit if Ctrl+C is pressed again
g_quit = true;
signalSetup();
@@ -349,6 +352,12 @@ int main(int argc, char** argv) try {
return 1;
}
po::notify(vm);
+
+ // initialize the verbose message sink
+ g_verbose_messages = vm.count("verbose")!=0;
+ sb.open(vsm);
+ std::clog.rdbuf(&sb);
+
if (vm.count("version")) {
// Already printed the version string in the beginning...
return 0;
@@ -414,11 +423,6 @@ int main(int argc, char** argv) try {
return 0;
}
- // initialize the verbose message sink
- g_verbose_messages = vm.count("verbose")!=0;
- sb.open(vsm);
- std::clog.rdbuf(&sb);
-
// Run the game init and main loop
mainLoop(songlist);
return 0; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
diff --git a/game/midifile.cc b/game/midifile.cc
index 8dfa3a8..b3ae920 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -80,7 +80,7 @@ MidiStream::Riff::Riff(MidiStream& ms): ms(ms), name(ms.read_bytes(4)), size(ms.
MidiStream::Riff::~Riff() {
#if MIDI_DEBUG_LEVEL > 0
- if (has_more_data()) std::cout << "WARNING: Only " << offset << " of " << size << " bytes read of RIFF chunk " << name << std::endl;
+ if (has_more_data()) std::clog << "WARNING: Only " << offset << " of " << size << " bytes read of RIFF chunk " << name << std::endl;
#endif
ms.f.seekg(pos + size);
}
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 67e2ce0..b7f1226 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -265,7 +265,7 @@ void SongParser::iniParse() {
std::ostringstream oss;
oss << "WARNING: Skipping " << reversedNoteCount << " reversed note(s) in ";
oss << s.path << s.midifilename << std::endl;
- std::cerr << oss.str(); // More likely to be atomic when written as one string
+ std::clog << oss.str(); // More likely to be atomic when written as one string
}
/*if (s.vocals.notes.empty()) {
Note n;
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 61dba03..42e88de 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -132,7 +132,7 @@ bool SongParser::txtParseNote(std::string line, VocalTrack &vocal) {
else { // Nothing to do, warn and skip
std::ostringstream oss;
oss << "WARNING: Skipping overlapping note in " << m_song.path << m_song.filename << std::endl;
- std::cerr << oss.str(); // More likely to be atomic when written as one string
+ std::clog << oss.str(); // More likely to be atomic when written as one string
return true;
}
} else throw std::runtime_error("The first note has negative timestamp");
diff --git a/game/songs.cc b/game/songs.cc
index 1bdb005..156c779 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -133,7 +133,7 @@ void Songs::filter_internal() {
boost::mutex::scoped_lock l(m_mutex);
// Print messages when loading has finished
if (!m_loading) {
- std::cerr << m_debug.str();
+ std::clog << m_debug.str();
m_debug.str(""); m_debug.clear();
}
m_dirty = false;
diff --git a/game/unicode.cc b/game/unicode.cc
index fa31716..a8faa58 100644
--- a/game/unicode.cc
+++ b/game/unicode.cc
@@ -8,7 +8,7 @@ void convertToUTF8( std::stringstream &_stream, std::string _filename ) {
try {
Glib::convert(_stream.str(), "UTF-8", "UTF-8"); // Test if input is UTF-8
} catch(...) {
- if (!_filename.empty()) std::cerr << "WARNING: " << _filename << " is not UTF-8.\n Assuming CP1252 for now. Use recode CP1252..UTF-8 */*.txt to convert your files." << std::endl;
+ if (!_filename.empty()) std::clog << "WARNING: " << _filename << " is not UTF-8.\n Assuming CP1252 for now. Use recode CP1252..UTF-8 */*.txt to convert your files." << std::endl;
try {
_stream.str(Glib::convert(_stream.str(), "UTF-8", "CP1252")); // Convert from Microsoft CP1252
} catch (...) {
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:22
|
Module: performous
Branch: joinmenu
Commit: 6d07ee1c6b17a303fba25550a8d99614d42efcf7
Author: Fredrik Klasson <fr...@li...>
Date: Tue Aug 3 23:52:29 2010 +0200
[+] std::clog can now be used for verbose messages (visible only if the
verbose arg (-V or --verbose) is passed at run-time).
[+] Refactoring the image loading code:
* Most of the caching logic is moved to cache.{cc,hh}
* SVG caching is now done by image.hh's loadSVG() (with the help of
cache.{cc,hh} and the new isThemeResource in fs.{cc,hh})
* surface.cc's loader() logic has been (ostensibly) simplified and
refactored to use the new filemagic.{cc,hh}; those are
well/overly(?) documented, but in short: (RTS for details ;)
* magic numbers of JPEG's and PNG's are used to identify them
* SVG's are still only tested for their extensions.
---
game/cache.cc | 25 ++++++++++++
game/cache.hh | 45 +++++++++++++++++++++
game/filemagic.hh | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++
game/fs.cc | 5 ++-
game/fs.hh | 3 +
game/image.hh | 16 ++++++-
game/main.cc | 24 +++++++++++
game/surface.cc | 53 +++++++-------------------
8 files changed, 238 insertions(+), 43 deletions(-)
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:20
|
Module: performous Branch: joinmenu Commit: 8abe9139081fb6690b1fcfb4c69e119dd480e5c9 Author: Vincent Le Ligeour <yo...@us...> Date: Fri Aug 6 18:45:29 2010 +0200 Merge branch 'controllers' --- |
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:18
|
Module: performous
Branch: joinmenu
Commit: 23b96bb4e3356ae02cb32f6517295bba801369f6
Author: Tapio Vierros <tap...@gm...>
Date: Thu Aug 5 20:48:34 2010 +0300
Fix godmode button mapping.
---
game/joystick.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 5053d99..ead308d 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -286,7 +286,7 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
else if(value == "yellow") mapping[id] = 2;
else if(value == "blue") mapping[id] = 3;
else if(value == "orange") mapping[id] = 4;
- else if(value == "starpower") mapping[id] = 5;
+ else if(value == "godmode") mapping[id] = 5;
else if(value == "select") mapping[id] = 8;
else if(value == "start") mapping[id] = 9;
else continue;
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:15
|
Module: performous
Branch: joinmenu
Commit: 7565ac76210114e651baf140b52ea29bcbbf97d1
Author: Tapio Vierros <tap...@gm...>
Date: Thu Aug 5 20:37:21 2010 +0300
Fix mixed-up start/select with guitars and drums.
---
game/joystick.cc | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index f9fceef..5053d99 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -287,8 +287,8 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
else if(value == "blue") mapping[id] = 3;
else if(value == "orange") mapping[id] = 4;
else if(value == "starpower") mapping[id] = 5;
- else if(value == "start") mapping[id] = 8;
- else if(value == "select") mapping[id] = 9;
+ else if(value == "select") mapping[id] = 8;
+ else if(value == "start") mapping[id] = 9;
else continue;
}
break;
@@ -304,8 +304,8 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
else if(value == "blue") mapping[id] = 3;
else if(value == "green") mapping[id] = 4;
else if(value == "orange") mapping[id] = 5;
- else if(value == "start") mapping[id] = 8;
- else if(value == "select") mapping[id] = 9;
+ else if(value == "select") mapping[id] = 8;
+ else if(value == "start") mapping[id] = 9;
else continue;
}
break;
@@ -349,7 +349,7 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
}
void input::SDL::init() {
- readControllers(g_instruments, getDefaultConfig(fs::path("/config/controllers.xml")));
+ readControllers(g_instruments, getDefaultConfig(fs::path("/config/controllers.xml")));
readControllers(g_instruments, getConfigDir() / "controllers.xml");
unsigned int sdl_id;
std::string instrument_type;
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:13
|
Module: performous
Branch: joinmenu
Commit: 4f9422a1e405e49c19ec0fd2b7370d9df46fe9c3
Author: Vincent Le Ligeour <yo...@us...>
Date: Thu Aug 5 19:24:40 2010 +0200
Fixed various controllers misdetection
---
data/controllers.xml | 2 +-
game/joystick.cc | 92 ++++++++++++++++---------------------------------
2 files changed, 31 insertions(+), 63 deletions(-)
diff --git a/data/controllers.xml b/data/controllers.xml
index eee2812..ab48239 100644
--- a/data/controllers.xml
+++ b/data/controllers.xml
@@ -97,7 +97,7 @@
</controller>
<controller type="drumkit" name="DRUMS_ROCKBAND_PS3">
<description>RockBand PS3 drum kit</description>
- <regexp match="Harmonix Drum [Kk]it for Playstation" />
+ <regexp match="Harmonix Drum [Kk]it for PlayStation" />
<mapping>
<button id="0" value="blue" />
<button id="1" value="green" />
diff --git a/game/joystick.cc b/game/joystick.cc
index c6c9c31..f9fceef 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -281,25 +281,15 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
int id = boost::lexical_cast<int>(getAttribute(button_elem, "id"));
std::string value = getAttribute(button_elem, "value");
if(id >= SDL_BUTTONS) break;
- if(value == "green") {
- mapping[id] = 0;
- } else if(value == "red") {
- mapping[id] = 1;
- } else if(value == "yellow") {
- mapping[id] = 2;
- } else if(value == "blue") {
- mapping[id] = 3;
- } else if(value == "orange") {
- mapping[id] = 4;
- } else if(value == "starpower") {
- mapping[id] = 5;
- } else if(value == "start") {
- mapping[id] = 8;
- } else if(value == "select") {
- mapping[id] = 9;
- } else {
- continue;
- }
+ if(value == "green") mapping[id] = 0;
+ else if(value == "red") mapping[id] = 1;
+ else if(value == "yellow") mapping[id] = 2;
+ else if(value == "blue") mapping[id] = 3;
+ else if(value == "orange") mapping[id] = 4;
+ else if(value == "starpower") mapping[id] = 5;
+ else if(value == "start") mapping[id] = 8;
+ else if(value == "select") mapping[id] = 9;
+ else continue;
}
break;
case input::DRUMS:
@@ -308,25 +298,15 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
int id = boost::lexical_cast<int>(getAttribute(button_elem, "id"));
std::string value = getAttribute(button_elem, "value");
if(id >= SDL_BUTTONS) break;
- if(value == "green") {
- mapping[id] = 0;
- } else if(value == "red") {
- mapping[id] = 1;
- } else if(value == "yellow") {
- mapping[id] = 2;
- } else if(value == "blue") {
- mapping[id] = 3;
- } else if(value == "orange") {
- mapping[id] = 4;
- } else if(value == "kick") {
- mapping[id] = 5;
- } else if(value == "start") {
- mapping[id] = 8;
- } else if(value == "select") {
- mapping[id] = 9;
- } else {
- continue;
- }
+ if(value == "kick") mapping[id] = 0;
+ else if(value == "red") mapping[id] = 1;
+ else if(value == "yellow") mapping[id] = 2;
+ else if(value == "blue") mapping[id] = 3;
+ else if(value == "green") mapping[id] = 4;
+ else if(value == "orange") mapping[id] = 5;
+ else if(value == "start") mapping[id] = 8;
+ else if(value == "select") mapping[id] = 9;
+ else continue;
}
break;
case input::DANCEPAD:
@@ -335,29 +315,17 @@ void readControllers(input::Instruments &instruments, fs::path const& file) {
int id = boost::lexical_cast<int>(getAttribute(button_elem, "id"));
std::string value = getAttribute(button_elem, "value");
if(id >= SDL_BUTTONS) break;
- if(value == "left") {
- mapping[id] = 0;
- } else if(value == "down") {
- mapping[id] = 1;
- } else if(value == "up") {
- mapping[id] = 2;
- } else if(value == "right") {
- mapping[id] = 3;
- } else if(value == "down-left") {
- mapping[id] = 4;
- } else if(value == "down-right") {
- mapping[id] = 5;
- } else if(value == "up-left") {
- mapping[id] = 6;
- } else if(value == "up-right") {
- mapping[id] = 7;
- } else if(value == "start") {
- mapping[id] = 8;
- } else if(value == "select") {
- mapping[id] = 9;
- } else {
- continue;
- }
+ if(value == "left") mapping[id] = 0;
+ else if(value == "down") mapping[id] = 1;
+ else if(value == "up") mapping[id] = 2;
+ else if(value == "right") mapping[id] = 3;
+ else if(value == "down-left") mapping[id] = 4;
+ else if(value == "down-right") mapping[id] = 5;
+ else if(value == "up-left") mapping[id] = 6;
+ else if(value == "up-right") mapping[id] = 7;
+ else if(value == "start") mapping[id] = 8;
+ else if(value == "select") mapping[id] = 9;
+ else continue;
}
break;
}
@@ -436,7 +404,7 @@ void input::SDL::init() {
for(input::Instruments::const_iterator it = g_instruments.begin() ; it != g_instruments.end() ; ++it) {
boost::regex sdl_name(it->second.match);
boost::cmatch match;
- if (regex_match(name.c_str(), match, sdl_name)) {
+ if (regex_search(name.c_str(), sdl_name)) {
std::cout << " Detected as: " << it->second.description << std::endl;
input::detail::devices.insert(std::make_pair<unsigned int, input::detail::InputDevPrivate>(i, input::detail::InputDevPrivate(it->second)));
found = true;
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:11
|
Module: performous
Branch: joinmenu
Commit: 7a4dedaa40563dd1c73c289409a29f8cd16e27fd
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Aug 4 22:47:34 2010 +0200
Fixed compilation when using portmidi
---
game/joystick.cc | 9 ++++-----
game/joystick.hh | 1 +
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index a782a1b..c6c9c31 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -3,10 +3,12 @@
#include <boost/lexical_cast.hpp>
#include <boost/regex.hpp>
+input::Instruments g_instruments;
+
#ifdef USE_PORTMIDI
input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_input"].s())), devnum(0x8000) {
while (detail::devices.find(devnum) != detail::devices.end()) ++devnum;
- detail::devices[devnum] = detail::InputDevPrivate(detail::DRUMS_MIDI);
+ detail::devices.insert(std::make_pair<unsigned int, input::detail::InputDevPrivate>(devnum, detail::InputDevPrivate(g_instruments.find("DRUMS_GUITARHERO")->second)));
event.type = Event::PRESS;
for (unsigned int i = 0; i < BUTTONS; ++i) event.pressed[i] = false;
#if 1
@@ -107,7 +109,7 @@ void input::MidiDrums::process() {
event.time = now();
for (unsigned int i = 0; i < BUTTONS; ++i) event.pressed[i] = false;
event.pressed[it->second] = true;
- detail::devices[devnum].addEvent(event);
+ detail::devices.find(devnum)->second.addEvent(event);
}
}
#endif
@@ -115,7 +117,6 @@ void input::MidiDrums::process() {
input::detail::InputDevs input::detail::devices;
input::SDL::SDL_devices input::SDL::sdl_devices;
-
/// Abstract navigation actions for different input devices, including keyboard
input::NavButton input::getNav(SDL_Event const &e) {
if (e.type == SDL_KEYDOWN) {
@@ -219,8 +220,6 @@ void input::SDL::init_devices() {
#include "fs.hh"
#include <libxml++/libxml++.h>
-input::Instruments g_instruments;
-
namespace {
struct XMLError {
XMLError(xmlpp::Element& e, std::string msg): elem(e), message(msg) {}
diff --git a/game/joystick.hh b/game/joystick.hh
index 2d433da..31e0f30 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -150,6 +150,7 @@ namespace input {
}
#ifdef USE_PORTMIDI
+ // Warning: MidiDrums should be instanciated after Window (that load joysticks)
class MidiDrums {
public:
static bool enabled() { return true; }
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:08
|
Module: performous Branch: joinmenu Commit: fffd58eb580f7c5721fd1b3c5f472bbeb9545573 Author: Vincent Le Ligeour <yo...@us...> Date: Wed Aug 4 22:01:23 2010 +0200 Implemented controllers config file --- data/controllers.xml | 166 ++++++++++++++++---------------------- game/joystick.cc | 215 ++++++++++++++++++++++++++++++++++++++++---------- game/joystick.hh | 2 +- 3 files changed, 245 insertions(+), 138 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:06
|
Module: performous
Branch: joinmenu
Commit: 9a5e53475d6530dc966baae4f29969508c5ec0de
Author: Tapio Vierros <tap...@gm...>
Date: Wed Aug 4 20:58:19 2010 +0300
Fix typo in previous commit.
---
cmake/Modules/FindGlib.cmake | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cmake/Modules/FindGlib.cmake b/cmake/Modules/FindGlib.cmake
index 607e593..b00d63e 100644
--- a/cmake/Modules/FindGlib.cmake
+++ b/cmake/Modules/FindGlib.cmake
@@ -21,7 +21,7 @@ find_path(Glib_INCLUDE_DIR
find_path(GlibConfig_INCLUDE_DIR
NAMES glibconfig.h
PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES /lib/glib-2.0/include ../lib/glib-2.0/include
+ PATH_SUFFIXES lib/glib-2.0/include ../lib/glib-2.0/include
)
# Finally the library itself
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:27:02
|
Module: performous
Branch: joinmenu
Commit: 72bbe45b394d875f5252e213d8ac10c1f7270dbc
Author: Tapio Vierros <tap...@gm...>
Date: Wed Aug 4 19:51:12 2010 +0300
Make CMake find libraries' config dirs better when using wierd prefixes.
Use case: cross-compiling
---
cmake/Modules/FindGlib.cmake | 2 +-
cmake/Modules/FindGlibmm.cmake | 2 +-
cmake/Modules/FindLibXML++.cmake | 2 +-
cmake/Modules/FindLibXML2.cmake | 1 +
cmake/Modules/FindSigC++.cmake | 2 +-
5 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/cmake/Modules/FindGlib.cmake b/cmake/Modules/FindGlib.cmake
index 7344dc2..607e593 100644
--- a/cmake/Modules/FindGlib.cmake
+++ b/cmake/Modules/FindGlib.cmake
@@ -21,7 +21,7 @@ find_path(Glib_INCLUDE_DIR
find_path(GlibConfig_INCLUDE_DIR
NAMES glibconfig.h
PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES lib/glib-2.0/include
+ PATH_SUFFIXES /lib/glib-2.0/include ../lib/glib-2.0/include
)
# Finally the library itself
diff --git a/cmake/Modules/FindGlibmm.cmake b/cmake/Modules/FindGlibmm.cmake
index 713657d..38f272a 100644
--- a/cmake/Modules/FindGlibmm.cmake
+++ b/cmake/Modules/FindGlibmm.cmake
@@ -25,7 +25,7 @@ find_path(Glibmm_INCLUDE_DIR
find_path(GlibmmConfig_INCLUDE_DIR
NAMES glibmmconfig.h
PATHS ${Glibmm_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES lib/glibmm-2.4/include
+ PATH_SUFFIXES lib/glibmm-2.4/include ../lib/glibmm-2.4/include
)
# Finally the library itself
diff --git a/cmake/Modules/FindLibXML++.cmake b/cmake/Modules/FindLibXML++.cmake
index 3eaa0d9..47aafda 100644
--- a/cmake/Modules/FindLibXML++.cmake
+++ b/cmake/Modules/FindLibXML++.cmake
@@ -25,7 +25,7 @@ find_path(LibXML++_INCLUDE_DIR
find_path(LibXML++Config_INCLUDE_DIR
NAMES libxml++config.h
PATHS ${LibXML++_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES lib/libxml++-2.6/include
+ PATH_SUFFIXES lib/libxml++-2.6/include ../lib/libxml++-2.6/include
)
# Finally the library itself
diff --git a/cmake/Modules/FindLibXML2.cmake b/cmake/Modules/FindLibXML2.cmake
index fa53219..8163e70 100644
--- a/cmake/Modules/FindLibXML2.cmake
+++ b/cmake/Modules/FindLibXML2.cmake
@@ -16,6 +16,7 @@ find_path(LibXML2_INCLUDE_DIR
NAMES libxml/xpath.h
PATHS ${LibXML2_PKGCONF_INCLUDE_DIRS}
PATHS ${LibXML2_PKGCONF_INCLUDE_DIRS}/libxml2
+ PATH_SUFFIXES libxml2
)
find_library(LibXML2_LIBRARY
diff --git a/cmake/Modules/FindSigC++.cmake b/cmake/Modules/FindSigC++.cmake
index 307ec6d..24325bd 100644
--- a/cmake/Modules/FindSigC++.cmake
+++ b/cmake/Modules/FindSigC++.cmake
@@ -21,7 +21,7 @@ find_path(SigC++_INCLUDE_DIR
find_path(SigC++Config_INCLUDE_DIR
NAMES sigc++config.h
PATHS ${SigC++_PKGCONF_INCLUDE_DIRS} /usr
- PATH_SUFFIXES lib/sigc++-2.0/include
+ PATH_SUFFIXES lib/sigc++-2.0/include ../lib/sigc++-2.0/include
)
# Finally the library itself
|
|
From: Tapio V. <aa...@us...> - 2010-08-12 21:26:59
|
Module: performous Branch: joinmenu Commit: b992f235f5266604469278a60535d47fdae492ed Author: Vincent Le Ligeour <yo...@us...> Date: Wed Aug 4 13:16:37 2010 +0200 Exploded instrument definition for simpliest code/maintainability --- data/controllers.xml | 26 ++++++++++++++++++++++++-- 1 files changed, 24 insertions(+), 2 deletions(-) diff --git a/data/controllers.xml b/data/controllers.xml index 7129607..5e83c9e 100644 --- a/data/controllers.xml +++ b/data/controllers.xml @@ -16,11 +16,22 @@ <button id="9" value="start" /> </mapping> </guitar> - <guitar name="GUITAR_RB_XBOX360"> + <guitar name="GUITAR_GH_XPLORER"> <match> <description>Guitar Hero X-plorer guitar</description> <regexp match="Guitar Hero X-plorer" /> </match> + <mapping> + <button id="0" value="green" /> + <button id="1" value="red" /> + <button id="2" value="blue" /> + <button id="3" value="yellow" /> + <button id="4" value="orange" /> + <button id="6" value="select" /> + <button id="7" value="start" /> + </mapping> + </guitar> + <guitar name="GUITAR_RB_XBOX360"> <match> <description>Rock Band guitar Xbox 360</description> <regexp match="Harmonix Guitar .* Xbox" /> @@ -83,11 +94,22 @@ <button id="9" value="start" /> </mapping> </drumkit> - <drumkit name="DRUMS_RB_PS3"> + <drumkit name="DRUMS_RB_WII"> <match> <description>RockBand Wii drum kit</description> <regexp match="Harmonix Drum Controller for Nintendo Wii" /> </match> + <mapping> + <button id="0" value="blue" /> + <button id="1" value="green" /> + <button id="2" value="red" /> + <button id="3" value="yellow" /> + <button id="4" value="kick" /> + <button id="8" value="select" /> + <button id="9" value="start" /> + </mapping> + </drumkit> + <drumkit name="DRUMS_RB_PS3"> <match> <description>RockBand PS3 drum kit</description> <regexp match="Harmonix Drum [Kk]it for Playstation" /> |