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...> - 2009-11-08 08:30:01
|
Module: performous
Branch: dance
Commit: 062885a60efd4cc1dfa0247756ed6ccdff446af7
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Oct 28 22:53:17 2009 +0200
Remove -fvisibility options (they were causing trouble on OSX)
---
game/CMakeLists.txt | 2 +-
libs/libda/CMakeLists.txt | 2 +-
libs/plugin++/CMakeLists.txt | 3 ---
3 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 18a4c11..20b0f94 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -30,7 +30,7 @@ endif(PortMidi_FOUND)
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
# -pedantic cannot be used because ffmpeg headers are b0rked
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -Wall -Wextra -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -std=c++98 -Wall -Wextra")
# Needed for ffmpeg.cc to compile cleanly on OSX (it's a (unsigned long) long story)
add_definitions("-D__STDC_CONSTANT_MACROS")
endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/libs/libda/CMakeLists.txt b/libs/libda/CMakeLists.txt
index e058461..3ecbe27 100644
--- a/libs/libda/CMakeLists.txt
+++ b/libs/libda/CMakeLists.txt
@@ -13,7 +13,7 @@ if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra")
if(NOT WIN32)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -fvisibility=hidden -fvisibility-inlines-hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
endif(NOT WIN32)
endif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index ee49943..1d215a4 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -6,9 +6,6 @@ include_directories(include)
if(CMAKE_COMPILER_IS_GNUCXX)
message(STATUS "GCC detected, adding compile flags")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98 -Wall -Wextra")
- if(NOT WIN32)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
- endif(NOT WIN32)
endif(CMAKE_COMPILER_IS_GNUCXX)
if (WIN32)
|
|
From: Tapio V. <aa...@us...> - 2009-11-08 08:30:00
|
Module: performous
Branch: dance
Commit: e61eac19c40835ecbc5dc89da806e0c4a5f27619
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Oct 28 22:52:45 2009 +0200
Slightly better handling of very short notes
---
game/guitargraph.cc | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index d170864..8c9e51f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -457,7 +457,8 @@ void GuitarGraph::drawNote(int fret, glutil::Color c, float tBeg, float tEnd, fl
}
float yBeg = time2y(tBeg);
float yEnd = time2y(tEnd);
- if (yBeg - 3 * fretWid >= yEnd) {
+ if (yBeg - 2 * fretWid >= yEnd) {
+ if (yEnd > yBeg - 3 * fretWid) yEnd = yBeg - 3 * fretWid; // Short note: render minimum renderable length
UseTexture tblock(m_button_l);
glutil::Begin block(GL_TRIANGLE_STRIP);
c.a = time2a(tBeg); glColor4fv(c);
@@ -480,6 +481,7 @@ void GuitarGraph::drawNote(int fret, glutil::Color c, float tBeg, float tEnd, fl
vertexPair(x, y, c, 0.25f);
vertexPair(x, yEnd, c, 0.0f);
} else {
+ // Too short note: only render the ring
c.a = time2a(tBeg); glColor4fv(c);
m_button.dimensions.center(time2y(tBeg)).middle(x);
m_button.draw();
|
|
From: Tapio V. <aa...@us...> - 2009-11-08 08:29:55
|
Module: performous
Branch: dance
Commit: b3da5bce553e47bc288dbce6bd3b3664cf0f8028
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed Oct 28 19:50:55 2009 +0200
Added debug for OSX testing
---
libs/libda/plugins/audio_dev_jack.cpp | 7 +++++++
libs/plugin++/include/plugin++/loader.hpp | 2 ++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/libs/libda/plugins/audio_dev_jack.cpp b/libs/libda/plugins/audio_dev_jack.cpp
index aea5a24..e9b25eb 100644
--- a/libs/libda/plugins/audio_dev_jack.cpp
+++ b/libs/libda/plugins/audio_dev_jack.cpp
@@ -2,10 +2,17 @@
#include <boost/lexical_cast.hpp>
#include <jack/jack.h>
#include <algorithm>
+#include <iostream>
namespace {
using namespace da;
+ struct Foo {
+ Foo() {
+ std::cerr << "JACK driver loading..." << std::endl;
+ }
+ } foo;
+
void handle_and_throw(jack_status_t status) {
if (status & JackServerFailed) throw std::runtime_error("Unable to connect to the JACK server");
if (status & JackServerError) throw std::runtime_error("Communication error with the JACK server");
diff --git a/libs/plugin++/include/plugin++/loader.hpp b/libs/plugin++/include/plugin++/loader.hpp
index 89519e6..396da3a 100644
--- a/libs/plugin++/include/plugin++/loader.hpp
+++ b/libs/plugin++/include/plugin++/loader.hpp
@@ -31,7 +31,9 @@ namespace plugin {
void load(fs::path const& path) {
for (fs::directory_iterator it(path), end; it != end; ++it) {
try {
+ std::cerr << "Loading " << it->string() << std::endl;
dlls.push_back(new dll(it->string()));
+ std::cerr << "Loaded." << std::endl;
} catch (std::runtime_error const& e) {
std::cerr << e.what() << std::endl;
} catch (...) {
|
|
From: Yoda-JM <yo...@us...> - 2009-11-07 18:38:29
|
Module: performous
Branch: master
Commit: 232a3e1f57c414faeb6479d1d18b1aa4a28ec5d2
Author: Vincent Le Ligeour <yo...@us...>
Date: Sat Nov 7 19:37:02 2009 +0100
Applied Spruit_elf hack for properfly parsing multiplayer txt files
---
game/songparser-txt.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 5204204..9ba1c67 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -85,6 +85,7 @@ bool SongParser::txtParseNote(std::string line) {
addBPM(ts, bpm);
return true;
}
+ if (line[0] == 'P') return true; //We ignore player information for now (multiplayer hack)
Note n;
n.type = Note::Type(iss.get());
unsigned int ts = m_prevts;
|
|
From: Tapio V. <aa...@us...> - 2009-11-07 16:08:42
|
Module: performous
Branch: master
Commit: 1f319d424719882f2d5299def9860fc36da81abd
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 7 18:07:27 2009 +0200
Moved RNG seeding to main()
---
game/backgrounds.cc | 2 --
game/main.cc | 2 ++
game/songs.cc | 1 -
3 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index a854442..8450234 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -12,7 +12,6 @@
#include <sstream>
#include <stdexcept>
#include <cstdlib>
-#include <ctime>
void Backgrounds::reload() {
if (m_loading) return;
@@ -48,7 +47,6 @@ void Backgrounds::reload_internal() {
m_loading = false;
{
boost::mutex::scoped_lock l(m_mutex);
- std::srand(time(NULL));
random_shuffle(m_bgs.begin(), m_bgs.end());
m_dirty = false;
m_bgiter = 0;
diff --git a/game/main.cc b/game/main.cc
index 6748fc5..5341fd5 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -27,6 +27,7 @@
#include <fstream>
#include <string>
#include <vector>
+#include <cstdlib>
volatile bool g_quit = false;
@@ -197,6 +198,7 @@ int main(int argc, char** argv) {
std::signal(SIGINT, quit);
std::signal(SIGTERM, quit);
std::ios::sync_with_stdio(false); // We do not use C stdio
+ std::srand(std::time(NULL));
// Parse commandline options
std::vector<std::string> mics;
std::vector<std::string> pdevs;
diff --git a/game/songs.cc b/game/songs.cc
index 0dbe269..f98ce87 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -134,7 +134,6 @@ void Songs::randomize_internal() {
rnd::mt19937 gen(gendev); // Make Mersenne Twister random number generator, seeded with random_device.
for (SongVector::const_iterator it = m_filtered.begin(); it != m_filtered.end(); ++it) (*it)->randomIdx = gen();
*/
- std::srand(std::time(NULL));
// Assign the songs randomIdx that is used for sorting in the "random" mode
for (SongVector::const_iterator it = m_filtered.begin(); it != m_filtered.end(); ++it) (*it)->randomIdx = std::rand();
m_order = 0; // Use randomIdx sort mode
|
|
From: Tapio V. <aa...@us...> - 2009-11-07 14:05:46
|
Module: performous
Branch: master
Commit: d810cb85072925167709eb6cfd9c2403b81cc901
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 7 16:03:47 2009 +0200
Seed the rng with time(), so that the backgrounds are randomized differently on each run.
---
game/backgrounds.cc | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 8450234..a854442 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -12,6 +12,7 @@
#include <sstream>
#include <stdexcept>
#include <cstdlib>
+#include <ctime>
void Backgrounds::reload() {
if (m_loading) return;
@@ -47,6 +48,7 @@ void Backgrounds::reload_internal() {
m_loading = false;
{
boost::mutex::scoped_lock l(m_mutex);
+ std::srand(time(NULL));
random_shuffle(m_bgs.begin(), m_bgs.end());
m_dirty = false;
m_bgiter = 0;
|
|
From: Tapio V. <aa...@us...> - 2009-11-03 20:37:25
|
Module: performous
Branch: master
Commit: 0ba3edc9c97959e8d5822512468a6608be8e9421
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 3 22:32:26 2009 +0200
Added support for rhythm and coop guitar tracks plus some broken track detection.
Additional guitar tracks are displayed in the song browser by interlaced guitar icons.
---
game/screen_sing.cc | 12 +++++++++++-
game/screen_songs.cc | 27 +++++++++++++++++----------
game/songparser-ini.cc | 16 +++++++++++++---
3 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 1cf8429..f4c85f8 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -53,6 +53,8 @@ void ScreenSing::enter() {
// Here we load alternatively guitar/bass tracks until no guitar controler is available
// then we load all the drums tracks until no drum controler is available (and place them in second position)
bool no_guitar = false;
+ bool no_guitar2 = false;
+ bool no_guitar3 = false;
bool no_bass = false;
while (1) {
try {
@@ -61,9 +63,17 @@ void ScreenSing::enter() {
} catch (std::runtime_error&) {no_guitar = true;}
try {
Instruments::iterator it = m_instruments.end();
+ m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, "coop guitar"));
+ } catch (std::runtime_error&) {no_guitar2 = true;}
+ try {
+ Instruments::iterator it = m_instruments.end();
m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, "bass"));
} catch (std::runtime_error&) {no_bass = true;}
- if( no_guitar && no_bass ) break;
+ try {
+ Instruments::iterator it = m_instruments.end();
+ m_instruments.insert(it, new GuitarGraph(m_audio, *m_song, "rhythm guitar"));
+ } catch (std::runtime_error&) {no_guitar3 = true;}
+ if( no_guitar && no_guitar2 && no_guitar3 && no_bass ) break;
}
while(1) {
try {
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 1b79007..7c0e6de 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -245,16 +245,23 @@ void ScreenSongs::draw() {
glTexCoord2f(0.25f, 1.0f); glVertex2f(x, dim.y2());
}
{
- // guitar
- alpha = (isTrackInside(song_display.track_map,"guitar")) ? 1.00 : 0.25;
- glutil::Begin block(GL_TRIANGLE_STRIP);
- glColor4f(1.0, 1.0, 1.0, alpha);
- x = dim.x1()+0.25*(dim.x2()-dim.x1());
- glTexCoord2f(0.25f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.25f, 1.0f); glVertex2f(x, dim.y2());
- x = dim.x1()+0.50*(dim.x2()-dim.x1());
- glTexCoord2f(0.50f, 0.0f); glVertex2f(x, dim.y1());
- glTexCoord2f(0.50f, 1.0f); glVertex2f(x, dim.y2());
+ // guitars
+ alpha = 1.0;
+ int guitarCount = 0;
+ if (isTrackInside(song_display.track_map,"guitar")) guitarCount++;
+ if (isTrackInside(song_display.track_map,"coop guitar")) guitarCount++;
+ if (isTrackInside(song_display.track_map,"rhythm guitar")) guitarCount++;
+ if (guitarCount == 0) { guitarCount = 1; alpha = 0.25; }
+ for (int i = guitarCount-1; i >= 0; i--) {
+ glutil::Begin block(GL_TRIANGLE_STRIP);
+ glColor4f(1.0, 1.0, 1.0, alpha);
+ x = dim.x1()+(0.25+i*0.04)*(dim.x2()-dim.x1());
+ glTexCoord2f(0.25f, 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(0.25f, 1.0f); glVertex2f(x, dim.y2());
+ x = dim.x1()+(0.50+i*0.04)*(dim.x2()-dim.x1());
+ glTexCoord2f(0.50f, 0.0f); glVertex2f(x, dim.y1());
+ glTexCoord2f(0.50f, 1.0f); glVertex2f(x, dim.y2());
+ }
}
{
// bass
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 4b53e57..a55d489 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -49,8 +49,8 @@ void SongParser::iniParse() {
// These are added features (not part of FoF)
else if (key == "cover") s.cover = value;
else if (key == "background") s.background = value;
- else if (key == "video") m_song.video = value;
- else if (key == "videogap") assign(m_song.videoGap, value);
+ else if (key == "video") s.video = value;
+ else if (key == "videogap") assign(s.videoGap, value);
// End of added features
}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
@@ -94,7 +94,8 @@ void SongParser::iniParse() {
else if (name == "T1 GEMS") name = "guitar"; // Some old MIDI files have a track named T1 GEMS
else if (name.substr(0, 5) != "PART ") continue;
else name.erase(0, 5);
- if (name == "GUITAR COOP") continue; // TODO: do something with these? They don't work in current version
+ if (name == "GUITAR COOP") name = "coop guitar";
+ if (name == "RHYTHM") name = "rhythm guitar";
if (name == "DRUM") name = "drums";
if (name == "DRUMS") name = "drums";
if (name == "BASS") name = "bass";
@@ -102,6 +103,7 @@ void SongParser::iniParse() {
// Process non-vocal tracks
if (name != "VOCALS") {
bool drums = (name == "drums");
+ int durCount = 0;
s.track_map.insert(make_pair(name,Track(name)));
NoteMap& nm2 = s.track_map.find(name)->second.nm;
for (MidiFileParser::NoteMap::const_iterator it2 = it->notes.begin(); it2 != it->notes.end(); ++it2) {
@@ -114,8 +116,16 @@ void SongParser::iniParse() {
if (beg > end) throw std::runtime_error("Reversed notes");
if (drums) end = beg;
dur.push_back(Duration(beg, end));
+ durCount++;
}
}
+ // If a track has only 20 or less frets it's most likely b0rked.
+ // This number has been extracted from broken song tracks, but
+ // it is probably DIFFICULTYCOUNT * different_frets.
+ if (durCount <= 20) {
+ nm2.clear();
+ s.track_map.erase(name);
+ }
continue;
}
// Process vocal tracks
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-03 07:03:15
|
Module: performous Branch: master Commit: 3c1d6b4f1b3aeae5fe505bf8fc7d6949cc681669 Author: Lasse Karkkainen <tro...@tr...> Date: Tue Nov 3 08:16:39 2009 +0200 Removing hardcoded paths and making Performous behave better in non-standard installation location and when the installation is relocated. Changes include relative RPATH and detecting data path from executable location. Also some cleanup to plugin++ DLL code. --- game/CMakeLists.txt | 7 +++++ game/config.cmake.hh | 2 + game/configuration.cc | 30 ++++++++++++--------- game/main.cc | 2 - game/selfpath.hh | 7 ----- libs/plugin++/CMakeLists.txt | 9 +++--- libs/plugin++/include/plugin++/execname.hpp | 9 ++++++ libs/plugin++/src/dll-posix.cpp | 17 ------------ libs/plugin++/src/dll-windows.cpp | 17 ------------ libs/plugin++/src/dll.cc | 29 ++++++++++++++++++++ game/selfpath.cc => libs/plugin++/src/execname.cc | 26 +++++++++--------- 11 files changed, 81 insertions(+), 74 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-03 04:57:13
|
Module: performous
Branch: master
Commit: e0ed3045c236aec1d7dffffdd9e618a6c35c3a7e
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Nov 3 05:38:36 2009 +0200
Do not assume that all the funny things that SDL reports are drumsets
---
game/joystick.cc | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index afbca00..741426a 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -109,13 +109,20 @@ void input::SDL::init() {
}
unsigned int nbjoysticks = SDL_NumJoysticks();
- std::cout << "Detecting " << nbjoysticks << " joysticks..." << std::endl;
-
for (unsigned int i = 0 ; i < nbjoysticks ; ++i) {
- input::SDL::sdl_devices[i] = SDL_JoystickOpen(i);
std::string name = SDL_JoystickName(i);
- std::cout << "Id: " << i << std::endl;
- std::cout << " Name: " << name << std::endl;
+ std::cout << "SDL joystick: " << name << std::endl;
+ SDL_Joystick* joy = SDL_JoystickOpen(i);
+ if (SDL_JoystickNumButtons(joy) == 0) {
+ std::cout << " Not suitable for Performous" << std::endl;
+ SDL_JoystickClose(joy);
+ continue;
+ }
+ input::SDL::sdl_devices[i] = joy;
+ std::cout << SDL_JoystickNumAxes(joy) << std::endl;
+ std::cout << SDL_JoystickNumBalls(joy) << std::endl;
+ std::cout << SDL_JoystickNumButtons(joy) << std::endl;
+ std::cout << SDL_JoystickNumHats(joy) << std::endl;
if( forced_type.find(i) != forced_type.end() ) {
switch(forced_type[i]) {
case input::Private::GUITAR_GH:
@@ -156,8 +163,7 @@ void input::SDL::init() {
// Here we should send an event to have correct state buttons
init_devices();
// Adding keyboard instrument
- std::cout << "Id: " << input::Private::KEYBOARD_ID << std::endl;
- std::cout << " Name: Keyboard (emulated guitar): " << (config["game/keyboard_guitar"].b() ? "disabled":"enabled") << std::endl;
+ std::cout << "Keyboard as guitar controller: " << (config["game/keyboard_guitar"].b() ? "disabled":"enabled") << std::endl;
input::SDL::sdl_devices[input::Private::KEYBOARD_ID] = NULL;
input::Private::devices[input::Private::KEYBOARD_ID] = input::Private::InputDevPrivate(input::Private::GUITAR_GH);
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-03 02:13:46
|
Module: performous
Branch: master
Commit: 3be2d201398b4e6baba09495c66c17bfa07ab84c
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Nov 3 04:13:27 2009 +0200
Add a function for finding where the executable is
---
game/selfpath.cc | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
game/selfpath.hh | 7 +++++++
2 files changed, 59 insertions(+), 0 deletions(-)
diff --git a/game/selfpath.cc b/game/selfpath.cc
new file mode 100644
index 0000000..69cfca3
--- /dev/null
+++ b/game/selfpath.cc
@@ -0,0 +1,52 @@
+#include "selfpath.hh"
+
+#if defined(_WIN32)
+#include <windows.h>
+boost::filesystem::path selfpath() {
+ char buf[1024];
+ DWORD ret = GetModuleFileName(NULL, buf, sizeof(buf));
+ if (ret == 0 || ret == sizeof(buf)) return boost::filesystem::path();
+ return buf;
+}
+#elif defined(__APPLE__) // Not tested
+#include <mach-o/dyld.h>
+boost::filesystem::path selfpath() {
+ char buf[1024];
+ uint32_t size = sizeof(buf);
+ int ret = _NSGetExecutablePath(buf, &size);
+ if (ret != 0) return boost::filesystem::path();
+ return buf;
+}
+#elif defined(sun) || defined(__sun)
+#include <stdlib.h>
+boost::filesystem::path selfpath() {
+ return getexecname();
+}
+#elif defined(__FreeBSD__)
+#include <sys/sysctl.h>
+boost::filesystem::path selfpath() {
+ int mib[4];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = -1;
+ char buf[1024];
+ size_t size = sizeof(buf);
+ sysctl(mib, 4, buf, &size, NULL, 0);
+ if (size == 0 || size == sizeof(buf)) return boost::filesystem::path();
+ return std::string(buf, size);
+}
+#elif defined(__linux__)
+#include <unistd.h>
+boost::filesystem::path selfpath() {
+ char buf[1024];
+ ssize_t ret = readlink("/proc/self/exe", buf, sizeof(buf));
+ if (ret == 0 || ret == sizeof(buf)) return boost::filesystem::path();
+ return std::string(buf, ret);
+}
+#else
+boost::filesystem::path selfpath() {
+ return boost::filesystem::path();
+}
+#endif
+
diff --git a/game/selfpath.hh b/game/selfpath.hh
new file mode 100644
index 0000000..5acbd12
--- /dev/null
+++ b/game/selfpath.hh
@@ -0,0 +1,7 @@
+#pragma once
+#include <boost/filesystem.hpp>
+
+/// Get the current executable name with path. Returns empty path if the name
+/// cannot be found. May return absolute or relative paths.
+boost::filesystem::path selfpath();
+
|
|
From: Yoda-JM <yo...@us...> - 2009-11-02 20:34:49
|
Module: web Branch: master Commit: 30beef8f16476673379f0ebbcf32453853ca5581 Author: Vincent Le Ligeour <yo...@us...> Date: Mon Nov 2 21:34:14 2009 +0100 Used Facebook performous username --- htdocs-source/AWC-cfg.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/htdocs-source/AWC-cfg.txt b/htdocs-source/AWC-cfg.txt index 0809a6c..c8c8907 100644 --- a/htdocs-source/AWC-cfg.txt +++ b/htdocs-source/AWC-cfg.txt @@ -14,7 +14,7 @@ .http://sourceforge.net/projects/performous/ SF.net .http://www.ohloh.net/projects/performous Ohloh.net .http://cia.vc/stats/project/performous CIA.vc -.http://www.facebook.com/pages/Performous/35682224529 Facebook +.http://www.facebook.com/performous Facebook .awstats/awstats.pl Site stats % Competing projects: .http://sourceforge.net/projects/ultrastardx/ UltraStar Deluxe |
|
From: Tapio V. <aa...@us...> - 2009-11-01 16:19:44
|
Module: performous
Branch: master
Commit: 155603f268a0cc2dc2abeb9cd019b9f78620d559
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 1 18:15:57 2009 +0200
Assume that an instrument difficulty level that has only one chord is broken (so don't show it).
---
game/guitargraph.cc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index a0704b1..edafa3b 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -323,8 +323,14 @@ bool GuitarGraph::difficulty(Difficulty level) {
int fail = 0;
for (int fret = 0; fret < 5; ++fret) if (nm.find(basepitch + fret) == nm.end()) ++fail;
if (fail == 5) return false;
+ Difficulty prevLevel = m_level;
m_level = level;
updateChords();
+ if (m_chords.size() <= 1) { // If there is only one chord, it's probably b0rked
+ m_level = prevLevel;
+ updateChords();
+ return false;
+ }
return true;
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-01 15:59:37
|
Module: performous Branch: master Commit: 5f68f1d9f0df08bfd5c5e533f90b262778c32381 Author: Tapio Vierros <tap...@gm...> Date: Sun Nov 1 17:56:05 2009 +0200 Added a default background image for song browser (for songs without one). --- game/screen_songs.cc | 3 +- game/screen_songs.hh | 1 + themes/default/songs_bg_default.svg | 388 +++++++++++++++++++++++++++++++++++ 3 files changed, 391 insertions(+), 1 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2009-11-01 15:11:58
|
Module: performous
Branch: master
Commit: eb0dc5d398b3390ade0bf1526360c263317ffbe3
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 1 17:10:03 2009 +0200
Small optimization for note drawing when no whammy is used.
---
game/guitargraph.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 8bf38c3..a0704b1 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -475,13 +475,13 @@ void GuitarGraph::drawNote(int fret, glutil::Color c, float tBeg, float tEnd, fl
y -= 2 * fretWid;
vertexPair(x, y, c, 0.5f);
// Render the middle
- while ((y -= fretWid) > yEnd + fretWid) {
- if (whammy < 0.1) {
- vertexPair(x, y, c, 0.5f);
- } else {
+ if (whammy > 0.1) {
+ while ((y -= fretWid) > yEnd + fretWid) {
// The sin formula is pure magic
vertexPair(x+sin((whammy-0.75)*6.0 + (yBeg-tEnd)/y)/3.0, y, c, 0.5f);
}
+ } else {
+ while ((y -= 10.0) > yEnd + fretWid) vertexPair(x, y, c, 0.5f);
}
// Render the end
y = yEnd + fretWid;
|
|
From: Tapio V. <aa...@us...> - 2009-11-01 14:55:59
|
Module: performous
Branch: master
Commit: 5318971840e5e2733d0b786a09b2b092fa264f60
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 1 16:48:41 2009 +0200
If there is no separate music tracks for instruments, don't completely kill off the audio when playing wrong.
---
game/screen_sing.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 397b543..1cf8429 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -106,6 +106,7 @@ void ScreenSing::instrumentLayout(double time) {
} else {
CountSum cs = volume[it->first];
if (cs.first > 0) level = cs.second / cs.first;
+ if (m_song->music.size() <= 1) level = std::max(0.333, level);
m_audio.streamFade(it->first, level);
}
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-01 01:30:15
|
Module: performous
Branch: master
Commit: 0a06ddc7ce7262d75674b09b962c4e9a9bb0746f
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Nov 1 03:29:54 2009 +0200
Disable switching between drums and guitars, do not use string keys and lookup all the time
---
game/guitargraph.cc | 51 +++++++++++++++++++++++++++++----------------------
game/guitargraph.hh | 10 ++++++----
2 files changed, 35 insertions(+), 26 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 8c9e51f..8bf38c3 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -54,6 +54,7 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
m_stream(),
+ m_track_index(m_track_map.end()),
m_level(),
m_dead(1000),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
@@ -81,19 +82,23 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, std::string track):
unsigned int i = 0;
for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it,++i) {
std::string index = it->first;
- m_track_map.insert(make_pair(index, &it->second));
- if( index == track ) m_track_index = index;
-
- // load required textures (even the unused)
- if (index == "drums") m_necks.insert(index, new Texture("drumneck.svg"));
- else if (index == "bass") m_necks.insert(index, new Texture("bassneck.svg"));
- else m_necks.insert(index, new Texture("guitarneck.svg"));
+ TrackMapConstPtr::const_iterator it2 = m_track_map.insert(std::make_pair(index, &it->second)).first;
+ if (index == track) m_track_index = it2;
}
- if( m_track_index.empty() ) throw std::runtime_error("Could not find track \"" + track + "\"");
+ if (m_track_index == m_track_map.end()) throw std::runtime_error("Could not find track \"" + track + "\"");
for (int i = 0; i < 6; ++i) m_hit[i].setRate(5.0);
for (int i = 0; i < 5; ++i) m_holds[i] = 0;
if (m_track_map.empty()) throw std::runtime_error("No track");
difficultyAuto();
+ updateNeck();
+}
+
+void GuitarGraph::updateNeck() {
+ // TODO: Optimize with texture cache
+ std::string index = m_track_index->first;
+ if (index == "drums") m_neck.reset(new Texture("drumneck.svg"));
+ else if (index == "bass") m_neck.reset(new Texture("bassneck.svg"));
+ else m_neck.reset(new Texture("guitarneck.svg"));
}
void GuitarGraph::engine() {
@@ -117,15 +122,7 @@ void GuitarGraph::engine() {
else if (ev.type == input::Event::PICK) m_hit[0].setValue(1.0);
if (time < -0.5) {
if (ev.type == input::Event::PICK || (m_drums && ev.type == input::Event::PRESS)) {
- if (m_drums ? ev.pressed[0] : ev.pressed[4]) {
- // lets find the next track
- TrackMapConstPtr::iterator track_it = m_track_map.find(m_track_index);
- if( track_it != m_track_map.end() ) {
- ++track_it;
- m_track_index = (track_it != m_track_map.end() ? track_it : m_track_map.begin())->first;
- }
- if (!difficulty(m_level)) difficultyAuto();
- }
+ if (!m_drums && ev.pressed[4]) nextTrack();
if (ev.pressed[0 + m_drums]) difficulty(DIFFICULTY_SUPAEASY);
else if (ev.pressed[1 + m_drums]) difficulty(DIFFICULTY_EASY);
else if (ev.pressed[2 + m_drums]) difficulty(DIFFICULTY_MEDIUM);
@@ -299,13 +296,23 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
}
}
-void GuitarGraph::difficultyAuto() {
+void GuitarGraph::nextTrack() {
+ while (1) {
+ if (++m_track_index == m_track_map.end()) m_track_index = m_track_map.begin();
+ if (m_track_index->first != "drums") break; // Only accept non-drum tracks
+ }
+ difficultyAuto();
+ updateNeck();
+}
+
+void GuitarGraph::difficultyAuto(bool tryKeep) {
+ if (tryKeep && difficulty(Difficulty(m_level))) return;
for (int level = 0; level < DIFFICULTYCOUNT; ++level) if (difficulty(Difficulty(level))) return;
throw std::runtime_error("No difficulty levels found");
}
bool GuitarGraph::difficulty(Difficulty level) {
- Track const& track = *m_track_map.find(m_track_index)->second;
+ Track const& track = *m_track_index->second;
// Find the stream number
for (TrackMap::const_iterator it = m_song.track_map.begin(); it != m_song.track_map.end(); ++it) {
if (&track == &it->second) break;
@@ -345,7 +352,7 @@ void GuitarGraph::draw(double time) {
// Draw scores
if (time < -0.5) {
std::string txt;
- txt += m_track_map.find(m_track_index)->first + "\n" + diffv[m_level].name;
+ txt += m_track_index->first + "\n" + diffv[m_level].name;
m_text.dimensions.screenBottom(-0.05).middle(-0.1 + offsetX);
m_text.draw(txt);
} else {
@@ -363,7 +370,7 @@ void GuitarGraph::draw(double time) {
{ float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
// Draw the neck
{
- UseTexture tex(*m_necks.find(m_track_index)->second);
+ UseTexture tex(*m_neck);
glutil::Begin block(GL_TRIANGLE_STRIP);
float w = (m_drums ? 2.0f : 2.5f);
float texCoord = 0.0f;
@@ -502,7 +509,7 @@ void GuitarGraph::updateChords() {
Durations::size_type pos[5] = {}, size[5] = {};
Durations const* durations[5] = {};
for (int fret = 0; fret < 5; ++fret) {
- NoteMap const& nm = m_track_map.find(m_track_index)->second->nm;
+ NoteMap const& nm = m_track_index->second->nm;
int basepitch = diffv[m_level].basepitch;
NoteMap::const_iterator it = nm.find(basepitch + fret);
if (it == nm.end()) continue;
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index e0eb849..c20b95e 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -49,13 +49,14 @@ class GuitarGraph {
/** draws GuitarGraph
* @param time at which time to draw
*/
+ void updateNeck();
void draw(double time);
void engine();
void position(double cx, double width) { m_cx.setTarget(cx); m_width.setTarget(width); }
double dead(double time) const { return time > -0.5 && m_dead > 50; }
unsigned stream() const { return m_stream; }
double correctness() const { return m_correctness.get(); }
- std::string getTrackIndex() const { return m_track_index; }
+ std::string getTrackIndex() const { return m_track_index->first; }
int getScore() const { return m_score * m_scoreFactor; }
private:
void fail(double time, int fret);
@@ -67,12 +68,12 @@ class GuitarGraph {
Texture m_button_l;
Surface m_tap;
AnimValue m_hit[6];
- boost::ptr_map<std::string,Texture> m_necks;
+ boost::scoped_ptr<Texture> m_neck;
bool m_drums;
AnimValue m_cx, m_width;
- std::string m_track_index;
std::size_t m_stream;
TrackMapConstPtr m_track_map;
+ TrackMapConstPtr::const_iterator m_track_index;
void drumHit(double time, int pad);
void guitarPlay(double time, input::Event const& ev);
enum Difficulty {
@@ -99,7 +100,8 @@ class GuitarGraph {
glutil::Color const& color(int fret) const;
void drawBar(double time, float h);
void drawNote(int fret, glutil::Color, float tBeg, float tEnd, float whammy = 0);
- void difficultyAuto();
+ void nextTrack();
+ void difficultyAuto(bool tryKeepCurrent = false);
bool difficulty(Difficulty level);
SvgTxtTheme m_text;
void updateChords();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-01 01:30:04
|
Module: performous
Branch: master
Commit: a6c9f3bb541f0ccec3afdfc6b1b63088b64ba7d8
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Nov 1 02:55:14 2009 +0200
Remove unused typedefs
---
game/notes.hh | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/game/notes.hh b/game/notes.hh
index 59c3fc6..e5caf5a 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -52,9 +52,6 @@ struct Track {
NoteMap nm;
};
-// TODO: remove the following two types
-typedef std::vector<Track> TrackVector;
-typedef std::vector<Track const*> TrackVectorConstPtr;
// keep these ones
typedef std::map<std::string,Track> TrackMap;
typedef std::map<std::string,Track const*> TrackMapConstPtr; // this one really needed ? can't we save only the map key for comparison ?
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-01 00:43:33
|
Module: performous
Branch: master
Commit: 7f743aa0dfc40ab9961c0ebdaca9f9d2fedec8a4
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Nov 1 02:35:07 2009 +0200
Make SELECT button quit from singing screen
---
game/screen_sing.cc | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index b1bc46f..397b543 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -182,7 +182,11 @@ void ScreenSing::manageEvent(SDL_Event event) {
}
} else if (event.type == SDL_JOYBUTTONDOWN) {
int button = event.jbutton.button;
- if (button == 8 || button == 9) m_audio.togglePause();
+ if (button == 9 /* START */) m_audio.togglePause();
+ if (button == 8 /* SELECT */) {
+ ScreenManager::getSingletonPtr()->activateScreen("Songs");
+ return;
+ }
}
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-30 17:37:23
|
Module: performous Branch: master Commit: 8b1c6e77c3dfab9517555f67f25d92a66e598ab4 Author: Lasse Karkkainen <tro...@tr...> Date: Fri Oct 30 19:37:15 2009 +0200 Merge branch 'master' of ssh://tronic@git.performous.org/gitroot/performous/performous --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-10-30 17:37:17
|
Module: performous
Branch: master
Commit: eb42d079490e031cf8722fc7ec41c4c9859cddb1
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Oct 30 19:35:40 2009 +0200
Fix the bad_alloc issue that has been around for a long time, even in 0.3 series.
---
game/engine.hh | 16 +++++++++++-----
game/song.cc | 2 ++
game/song.hh | 1 +
game/songparser.hh | 2 ++
4 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/game/engine.hh b/game/engine.hh
index 49b401c..ee00df9 100644
--- a/game/engine.hh
+++ b/game/engine.hh
@@ -19,6 +19,8 @@ namespace {
size_t playerColorsSize = sizeof(playerColors) / sizeof(*playerColors);
}
+#include <iostream>
+
/// performous engine
class Engine {
Audio& m_audio;
@@ -44,11 +46,15 @@ class Engine {
// clear old player information
m_players.cur.clear();
m_players.scores.clear();
-
- size_t frames = m_audio.getLength() / Engine::TIMESTEP;
- while (anBegin != anEnd) m_players.cur.push_back(Player(song, *anBegin++, frames));
- size_t player = 0;
- for (std::list<Player>::iterator it = m_players.cur.begin(); it != m_players.cur.end(); ++it, ++player) it->m_color = playerColors[player % playerColorsSize];
+ // Only add players if the vocal track has sensible length (not NaN or extremely long)
+ std::cout << "Endtime: " << song.endTime << std::endl;
+ if (song.endTime < 10000.0) {
+ // Calculate the space required for pitch frames
+ size_t frames = song.endTime / Engine::TIMESTEP;
+ while (anBegin != anEnd) m_players.cur.push_back(Player(song, *anBegin++, frames));
+ size_t player = 0;
+ for (std::list<Player>::iterator it = m_players.cur.begin(); it != m_players.cur.end(); ++it, ++player) it->m_color = playerColors[player % playerColorsSize];
+ }
m_thread.reset(new boost::thread(boost::ref(*this)));
}
~Engine() { kill(); }
diff --git a/game/song.cc b/game/song.cc
index 1bf5b4f..d75d92a 100644
--- a/game/song.cc
+++ b/game/song.cc
@@ -1,6 +1,7 @@
#include "song.hh"
#include "songparser.hh"
+#include "util.hh"
#include <limits>
#include <algorithm>
@@ -25,6 +26,7 @@ void Song::reload(bool errorIgnore) {
noteMax = std::numeric_limits<int>::min();
videoGap = 0.0;
start = 0.0;
+ beginTime = endTime = getNaN();
m_scoreFactor = 0.0;
try { SongParser(*this); } catch (...) { if (!errorIgnore) throw; }
collateUpdate();
diff --git a/game/song.hh b/game/song.hh
index dd3e9df..f02bf87 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -73,6 +73,7 @@ class Song: boost::noncopyable {
std::vector<double> pitchPitchGraph; ///< pitch of pitch graph
std::vector<double> volumePitchGraph; ///< volume of pitch graph
std::vector<bool> drawPitchGraph; ///< if pitch graph should be drawn
+ double beginTime, endTime; ///< the period where there are notes
double m_scoreFactor; ///< Normalization factor for the scoring system
};
diff --git a/game/songparser.hh b/game/songparser.hh
index 7be9ee4..d17b147 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -76,6 +76,8 @@ class SongParser {
it->notePrev += shift;
}
}
+ // Set begin/end times
+ if (!s.notes.empty()) s.beginTime = s.notes.front().begin, s.endTime = s.notes.back().end;
m_song.m_scoreFactor = 1.0 / m_maxScore;
}
private:
|
|
From: Yoda-JM <yo...@us...> - 2009-10-30 16:29:35
|
Module: performous
Branch: master
Commit: 16cc19c81d94cb0db32ec8a4fef071b6e582d5ed
Author: Vincent Le Ligeour <yo...@us...>
Date: Fri Oct 30 17:29:00 2009 +0100
Added installation directory to background directory list
---
game/backgrounds.cc | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 14b4090..8450234 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -16,7 +16,13 @@
void Backgrounds::reload() {
if (m_loading) return;
// Copy backgrounddirs from config into m_bgdirs
- ConfigItem::StringList const& sd = config["system/path_backgrounds"].sl();
+ ConfigItem::StringList sd = config["system/path_backgrounds"].sl();
+ char const* env_data_dir = getenv("PERFORMOUS_DATA_DIR");
+ if (env_data_dir) {
+ std::string background_dir(env_data_dir);
+ background_dir.append("/backgrounds/");
+ sd.push_back(background_dir);
+ }
m_bgs.clear();
std::transform(sd.begin(), sd.end(), std::inserter(m_bgdirs, m_bgdirs.end()), pathMangle);
// Run loading thread
|
|
From: Tapio V. <aa...@us...> - 2009-10-30 14:06:18
|
Module: performous Branch: dance Commit: 20f7361fc537f62d72f373395de85292fc3e53a1 Author: Tapio Vierros <tap...@gm...> Date: Thu Oct 29 15:06:22 2009 +0200 Added a simple arrow for testing dancegraph. --- themes/default/arrow.svg | 107 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 107 insertions(+), 0 deletions(-) diff --git a/themes/default/arrow.svg b/themes/default/arrow.svg new file mode 100644 index 0000000..64219ca --- /dev/null +++ b/themes/default/arrow.svg @@ -0,0 +1,107 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="109.22793" + height="125.19736" + id="svg1901" + sodipodi:version="0.32" + inkscape:version="0.47pre4 r22446" + sodipodi:docname="arrow.svg" + version="1.1"> + <defs + id="defs1903"> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective7" /> + <inkscape:perspective + id="perspective3609" + inkscape:persp3d-origin="0.5 : 0.33333333 : 1" + inkscape:vp_z="1 : 0.5 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 0.5 : 1" + sodipodi:type="inkscape:persp3d" /> + <inkscape:perspective + id="perspective3631" + inkscape:persp3d-origin="0.5 : 0.33333333 : 1" + inkscape:vp_z="1 : 0.5 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_x="0 : 0.5 : 1" + sodipodi:type="inkscape:persp3d" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="1.979899" + inkscape:cx="131.20005" + inkscape:cy="16.74754" + inkscape:document-units="px" + inkscape:current-layer="layer1" + inkscape:window-width="789" + inkscape:window-height="826" + inkscape:window-x="634" + inkscape:window-y="22" + showgrid="false" + inkscape:window-maximized="0" /> + <metadata + id="metadata1906"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title></dc:title> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Taso 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-160.26987,-378.39184)"> + <rect + style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.22426020999999996;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + id="rect2823-7" + width="22.499096" + height="81.087944" + x="417.73743" + y="111.99822" + ry="7.3112082" + transform="matrix(0.70447892,0.70972491,-0.70972491,0.70447892,0,0)" + rx="11.249548" /> + <rect + style="opacity:0.9;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.22426020999999996;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + id="rect2823-7-0" + width="22.499096" + height="81.087944" + x="-137.28905" + y="418.45737" + ry="7.3112082" + transform="matrix(0.70636938,-0.70784341,0.70784341,0.70636938,0,0)" + rx="11.249548" /> + <rect + style="opacity:1;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.50000000000000000;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + id="rect2823" + width="22.223356" + height="123.23861" + x="203.04066" + y="379.60059" + ry="11.111678" /> + </g> +</svg> |
|
From: Tapio V. <aa...@us...> - 2009-10-29 22:43:56
|
Module: performous
Branch: master
Commit: 25703d0bb7eb185dc9f66c3226f45b54f9d45adc
Author: Tapio Vierros <tap...@gm...>
Date: Fri Oct 30 00:42:51 2009 +0200
Added fancy exception to Backgrounds' getRandom.
---
game/backgrounds.cc | 4 ++++
game/backgrounds.hh | 5 +----
game/screen_sing.cc | 3 ++-
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 365d741..14b4090 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -71,4 +71,8 @@ void Backgrounds::reload_internal(fs::path const& parent) {
}
}
+std::string Backgrounds::getRandom() {
+ if (m_bgs.empty()) throw std::runtime_error("No random backgrounds available");
+ return m_bgs.at((++m_bgiter) % m_bgs.size());
+}
diff --git a/game/backgrounds.hh b/game/backgrounds.hh
index a193c6d..f25e2aa 100644
--- a/game/backgrounds.hh
+++ b/game/backgrounds.hh
@@ -31,10 +31,7 @@ class Backgrounds: boost::noncopyable {
/// true if empty
int empty() const { return m_bgs.empty(); };
/// returns random background
- std::string getRandom() {
- if (!m_bgs.empty()) return m_bgs.at((++m_bgiter) % m_bgs.size());
- else return "";
- }
+ std::string getRandom();
private:
typedef std::set<fs::path> BGDirs;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 94061c5..b1bc46f 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -34,7 +34,8 @@ void ScreenSing::enter() {
}
if (foundbg == false) {
try {
- m_background.reset(new Surface(m_backgrounds.getRandom(), true));
+ std::string bgpath = m_backgrounds.getRandom();
+ m_background.reset(new Surface(bgpath, true));
} catch (std::exception& e) {
std::cerr << e.what() << std::endl;
}
|
|
From: Tapio V. <aa...@us...> - 2009-10-29 22:19:52
|
Module: performous
Branch: master
Commit: 27e2ac715817b138440abb81fa0eebd9e91ba8b7
Author: Tapio Vierros <tap...@gm...>
Date: Fri Oct 30 00:18:20 2009 +0200
Removed a debug message and elaborated scanning message.
---
game/backgrounds.cc | 2 +-
game/backgrounds.hh | 1 -
2 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 14816f8..365d741 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -31,7 +31,7 @@ void Backgrounds::reload_internal() {
m_dirty = true;
}
for (BGDirs::const_iterator it = m_bgdirs.begin(); m_loading && it != m_bgdirs.end(); ++it) {
- if (!fs::is_directory(*it)) { std::cout << ">>> Not scanning: " << *it << " (no such directory)" << std::endl; continue; }
+ 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;
size_t count = m_bgs.size();
reload_internal(*it);
diff --git a/game/backgrounds.hh b/game/backgrounds.hh
index 5d85da6..a193c6d 100644
--- a/game/backgrounds.hh
+++ b/game/backgrounds.hh
@@ -16,7 +16,6 @@ class Backgrounds: boost::noncopyable {
/// constructor
Backgrounds(): m_bgiter(0), m_dirty(false), m_loading(false)
{
- std::cout << "BACKGROUNDS!" << std::endl;
reload();
}
~Backgrounds() {
|
|
From: Tapio V. <aa...@us...> - 2009-10-29 22:06:54
|
Module: performous Branch: master Commit: e389a7bb6c898206451338f81b81c4d91055d0dc Author: Tapio Vierros <tap...@gm...> Date: Thu Oct 29 23:50:54 2009 +0200 Added some background dirs to the config xml. --- data/schema.xml | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/data/schema.xml b/data/schema.xml index 55981f0..400fe54 100644 --- a/data/schema.xml +++ b/data/schema.xml @@ -249,4 +249,14 @@ to save the current settings to XML. <long>Where to look for pictures of players.</long> </locale> </entry> + <entry name="system/path_backgrounds" type="string_list"> + <stringvalue>/usr/local/share/games/performous/backgrounds</stringvalue> + <stringvalue>/usr/share/games/performous/backgrounds</stringvalue> + <stringvalue>../backgrounds/</stringvalue><!-- For Windows where the program is started in bin/ --> + <stringvalue>~/.performous/backgrounds/</stringvalue> + <locale name="C"> + <short>Random background folders</short> + <long>Where to look for default backgrounds.</long> + </locale> + </entry> </performous> |