You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-30 08:04:24
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon May 30 11:03:32 2011 +0300
Implement proper reloadGL for all important screens.
---
game/screen_intro.cc | 6 ++-
game/screen_intro.hh | 1 +
game/screen_practice.cc | 6 ++-
game/screen_practice.hh | 1 +
game/screen_sing.cc | 110 ++++++++++++++++++++++++-----------------------
game/screen_sing.hh | 1 +
game/screen_songs.cc | 14 ++++--
game/screen_songs.hh | 1 +
8 files changed, 79 insertions(+), 61 deletions(-)
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index a15ab0b..6109b06 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -18,7 +18,6 @@ void ScreenIntro::enter() {
m_audio.playMusic(getThemePath("menu.ogg"), true);
m_selAnim = AnimValue(0.0, 10.0);
m_submenuAnim = AnimValue(0.0, 3.0);
- theme.reset(new ThemeIntro());
populateMenu();
if( m_first ) {
std::string msg;
@@ -26,6 +25,11 @@ void ScreenIntro::enter() {
if (!msg.empty()) ScreenManager::getSingletonPtr()->dialog(msg + _("\nPlease configure some before playing."));
m_first = false;
}
+ reloadGL();
+}
+
+void ScreenIntro::reloadGL() {
+ theme.reset(new ThemeIntro());
}
void ScreenIntro::exit() {
diff --git a/game/screen_intro.hh b/game/screen_intro.hh
index 2f1e572..2c08226 100644
--- a/game/screen_intro.hh
+++ b/game/screen_intro.hh
@@ -17,6 +17,7 @@ class ScreenIntro : public Screen {
ScreenIntro(std::string const& name, Audio& audio);
void enter();
void exit();
+ void reloadGL();
void manageEvent(SDL_Event event);
void draw();
diff --git a/game/screen_practice.cc b/game/screen_practice.cc
index 6d56289..27bcc21 100644
--- a/game/screen_practice.cc
+++ b/game/screen_practice.cc
@@ -13,7 +13,6 @@ ScreenPractice::ScreenPractice(std::string const& name, Audio& audio):
void ScreenPractice::enter() {
m_audio.playMusic(getThemePath("practice.ogg"));
- theme.reset(new ThemePractice());
// draw vu meters
for (unsigned int i = 0, mics = m_audio.analyzers().size(); i < mics; ++i) {
m_vumeters.push_back(new ProgressBar(getThemePath("vumeter_bg.svg"), getThemePath("vumeter_fg.svg"), ProgressBar::VERTICAL, 0.136, 0.023));
@@ -25,6 +24,11 @@ void ScreenPractice::enter() {
m_samples.push_back("drum tom1");
m_samples.push_back("drum cymbal");
//m_samples.push_back("drum tom2");
+ reloadGL();
+}
+
+void ScreenPractice::reloadGL() {
+ theme.reset(new ThemePractice());
}
void ScreenPractice::exit() {
diff --git a/game/screen_practice.hh b/game/screen_practice.hh
index 6c20b52..bb0ae1e 100644
--- a/game/screen_practice.hh
+++ b/game/screen_practice.hh
@@ -16,6 +16,7 @@ class ScreenPractice : public Screen {
ScreenPractice(std::string const& name, Audio& audio);
void enter();
void exit();
+ void reloadGL();
void manageEvent( SDL_Event event );
void draw();
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 5ba975c..a64505e 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -31,9 +31,6 @@ namespace {
void ScreenSing::enter() {
ScreenManager* sm = ScreenManager::getSingletonPtr();
- sm->loading(_("Loading theme..."), 0.0);
- theme.reset(new ThemeSing());
- m_menuTheme.reset(new ThemeInstrumentMenu());
sm->loading(_("Loading song..."), 0.3);
// Load the rest of the song
if (m_song->loadStatus != Song::FULL) {
@@ -44,18 +41,6 @@ void ScreenSing::enter() {
sm->activateScreen("Songs");
}
}
- // Load background
- sm->loading(_("Loading background..."), 0.4);
- bool foundbg = false;
- if (!m_song->background.empty()) { // Load bg image
- try {
- m_background.reset(new Surface(m_song->path + m_song->background));
- foundbg = true;
- } catch (std::exception& e) {
- m_song->background = "";
- std::cerr << e.what() << std::endl;
- }
- }
// Initialize webcam
sm->loading(_("Initializing webcam..."), 0.5);
if (config["graphic/webcam"].b() && Webcam::enabled()) {
@@ -68,25 +53,6 @@ void ScreenSing::enter() {
if (!m_song->video.empty() && config["graphic/video"].b()) {
m_video.reset(new Video(m_song->path + m_song->video, m_song->videoGap));
}
- // Use random bg if specified fails (also for tracks with video)
- if (!foundbg) {
- sm->loading(_("Random background..."), 0.65);
- for (int i = 1; i <= 2; ++i) { // Try two times in case first is b0rked
- try {
- std::string bgpath = m_backgrounds.getRandom();
- m_background.reset(new Surface(bgpath));
- break;
- } catch (std::exception& e) {
- std::cerr << e.what() << std::endl;
- }
- }
- }
- sm->loading(_("Loading user interface..."), 0.7);
- m_pause_icon.reset(new Surface(getThemePath("sing_pause.svg")));
- m_help.reset(new Surface(getThemePath("instrumenthelp.svg")));
- m_progress.reset(new ProgressBar(getThemePath("sing_progressbg.svg"), getThemePath("sing_progressfg.svg"), ProgressBar::HORIZONTAL, 0.01f, 0.01f, true));
- m_progress->dimensions.fixedWidth(0.4).left(-0.5).screenTop();
- theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
boost::ptr_vector<Analyzer>& analyzers = m_audio.analyzers();
m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(m_selectedTrack), m_database, theme));
// Load instrument and dance tracks
@@ -140,12 +106,67 @@ void ScreenSing::enter() {
sm->loading(_("Finalizing..."), 0.95);
m_audio.playMusic(m_song->music, false, 0.0, setup_delay);
m_engine.reset(new Engine(m_audio, m_song->getVocalTrack(m_selectedTrack), analyzers.begin(), analyzers.end(), m_database));
- sm->loading(_("Loading complete"), 1.0);
// Notify about broken tracks
if (m_song->b0rkedTracks) ScreenManager::getSingletonPtr()->dialog(_("Song contains broken tracks!"));
sm->showLogo(false);
+ sm->loading(_("Loading graphics..."), 0.9);
+ reloadGL();
+ sm->loading(_("Loading complete"), 1.0);
}
+void ScreenSing::reloadGL() {
+ ScreenManager* sm = ScreenManager::getSingletonPtr();
+ // Load UI graphics
+ theme.reset(new ThemeSing());
+ m_menuTheme.reset(new ThemeInstrumentMenu());
+ m_pause_icon.reset(new Surface(getThemePath("sing_pause.svg")));
+ m_help.reset(new Surface(getThemePath("instrumenthelp.svg")));
+ m_progress.reset(new ProgressBar(getThemePath("sing_progressbg.svg"), getThemePath("sing_progressfg.svg"), ProgressBar::HORIZONTAL, 0.01f, 0.01f, true));
+ m_progress->dimensions.fixedWidth(0.4).left(-0.5).screenTop();
+ theme->timer.dimensions.screenTop(0.5 * m_progress->dimensions.h());
+ // Load background
+ bool foundbg = false;
+ if (!m_song->background.empty()) { // Load bg image
+ try {
+ m_background.reset(new Surface(m_song->path + m_song->background));
+ foundbg = true;
+ } catch (std::exception& e) {
+ m_song->background = "";
+ std::cerr << e.what() << std::endl;
+ }
+ }
+ // Use random bg if specified fails (also for tracks with video)
+ if (!foundbg) {
+ sm->loading(_("Random background..."), 0.65);
+ try {
+ std::string bgpath = m_backgrounds.getRandom();
+ m_background.reset(new Surface(bgpath));
+ } catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ }
+}
+
+void ScreenSing::exit() {
+ m_engine.reset();
+ m_score_window.reset();
+ m_menu.clear();
+ m_instruments.clear();
+ m_dancers.clear();
+ m_layout_singer.reset();
+ m_help.reset();
+ m_pause_icon.reset();
+ m_cam.reset();
+ m_video.reset();
+ m_background.reset();
+ m_song->dropNotes();
+ m_menuTheme.reset();
+ theme.reset();
+ if (m_audio.isPaused()) m_audio.togglePause();
+ ScreenManager::getSingletonPtr()->showLogo();
+}
+
+
/// Manages the instrument drawing
/// Returns false if no instuments are alive
@@ -238,25 +259,6 @@ void ScreenSing::danceLayout(double time) {
}
}
-void ScreenSing::exit() {
- m_engine.reset();
- m_score_window.reset();
- m_menu.clear();
- m_instruments.clear();
- m_dancers.clear();
- m_layout_singer.reset();
- m_help.reset();
- m_pause_icon.reset();
- m_cam.reset();
- m_video.reset();
- m_background.reset();
- m_song->dropNotes();
- m_menuTheme.reset();
- theme.reset();
- if (m_audio.isPaused()) m_audio.togglePause();
- ScreenManager::getSingletonPtr()->showLogo();
-}
-
void ScreenSing::activateNextScreen()
{
ScreenManager* sm = ScreenManager::getSingletonPtr();
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 0b63066..b3dd744 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -53,6 +53,7 @@ class ScreenSing: public Screen {
{}
void enter();
void exit();
+ void reloadGL();
void manageEvent(SDL_Event event);
void draw();
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index e6890a8..9d5176b 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -21,6 +21,15 @@ ScreenSongs::ScreenSongs(std::string const& name, Audio& audio, Songs& songs, Da
}
void ScreenSongs::enter() {
+ m_songs.setFilter(m_search.text);
+ m_audio.fadeout();
+ m_jukebox = false;
+ show_hiscores = false;
+ hiscore_start_pos = 0;
+ reloadGL();
+}
+
+void ScreenSongs::reloadGL() {
theme.reset(new ThemeSongs());
m_songbg_default.reset(new Surface(getThemePath("songs_bg_default.svg")));
m_songbg_ground.reset(new Surface(getThemePath("songs_bg_ground.svg")));
@@ -29,11 +38,6 @@ void ScreenSongs::enter() {
m_bandCover.reset(new Surface(getThemePath("band_cover.svg")));
m_danceCover.reset(new Surface(getThemePath("dance_cover.svg")));
m_instrumentList.reset(new Texture(getThemePath("instruments.svg")));
- m_songs.setFilter(m_search.text);
- m_audio.fadeout();
- m_jukebox = false;
- show_hiscores = false;
- hiscore_start_pos = 0;
}
void ScreenSongs::exit() {
diff --git a/game/screen_songs.hh b/game/screen_songs.hh
index c5c38ef..4fd16ff 100644
--- a/game/screen_songs.hh
+++ b/game/screen_songs.hh
@@ -30,6 +30,7 @@ public:
ScreenSongs(std::string const& name, Audio& audio, Songs& songs, Database& database);
void enter();
void exit();
+ void reloadGL();
void manageSharedKey(input::NavButton nav); ///< same behaviour for jukebox and normal mode
void manageEvent(SDL_Event event);
void draw();
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-30 08:04:18
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon May 30 10:45:01 2011 +0300
Allow screens to do their own OpenGL reload handling.
---
game/main.cc | 3 +--
game/screen.hh | 4 ++++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index cc08f5a..db3adde 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -109,8 +109,7 @@ static void checkEvents_SDL(ScreenManager& sm) {
}
if (config["graphic/fullscreen"].b() != sm.window().getFullscreen()) {
sm.window().setFullscreen(config["graphic/fullscreen"].b());
- // Reloading the screen seems to counter window going white on Windows and possibly OSX
- sm.activateScreen(sm.getCurrentScreen()->getName());
+ sm.reloadGL();
}
}
diff --git a/game/screen.hh b/game/screen.hh
index 189d50b..1ea4fbd 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -25,6 +25,8 @@ class Screen {
virtual void enter() = 0;
/// exits screen
virtual void exit() = 0;
+ /// reloads OpenGL textures but avoids restarting music etc.
+ virtual void reloadGL() { exit(); enter(); }
/// returns screen name
std::string getName() const { return m_name; }
@@ -49,6 +51,8 @@ class ScreenManager: public Singleton <ScreenManager> {
void updateScreen();
/// Draws the current screen and possible transition effects
void drawScreen();
+ /// Reload OpenGL resources (after fullscreen toggle etc)
+ void reloadGL() { if (currentScreen) currentScreen->reloadGL(); }
/// Returns pointer to current Screen
Screen* getCurrentScreen() { return currentScreen; };
/// Returns pointer to Screen for given name
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-30 08:04:11
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon May 30 10:10:53 2011 +0300
Partial fix for fullscreen toggle on Gnome 3 and other composited desktops.
---
game/video_driver.cc | 44 +++++++++++++++++++++-----------------------
game/video_driver.hh | 10 +++++-----
2 files changed, 26 insertions(+), 28 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 06e7b09..e173d22 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -51,7 +51,7 @@ namespace {
unsigned int screenW() { return s_width; }
unsigned int screenH() { return s_height; }
-Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(width), m_windowH(height), m_fullscreen(fs) {
+Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(width), m_windowH(height), m_fullscreen(fs), screen() {
std::atexit(SDL_Quit);
if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) == -1 ) throw std::runtime_error("SDL_Init failed");
SDL_WM_SetCaption(PACKAGE " " VERSION, PACKAGE);
@@ -263,31 +263,11 @@ void Window::swap() {
}
void Window::setFullscreen(bool _fs) {
+ if (m_fullscreen == _fs) return;
m_fullscreen = _fs;
resize();
}
-bool Window::getFullscreen() const {
- return m_fullscreen;
-}
-
-void Window::screenshot() {
- Image img;
- img.w = m_fullscreen ? m_fsW : m_windowW;
- img.h = m_fullscreen ? m_fsH : m_windowH;
- img.data.resize(((img.w + 3) & ~3) * img.h * 3);
- img.format = pix::RGB;
- img.reverse = true;
- // Get pixel data from OpenGL
- glReadPixels(0, 0, img.w, img.h, GL_RGB, GL_UNSIGNED_BYTE, &img.data[0]);
- // Compose filename from timestamp
- fs::path filename = getHomeDir() / ("Performous_" + to_iso_string(boost::posix_time::second_clock::local_time()) + ".png");
- // Save to disk
- writePNG(filename.string(), img);
- std::clog << "video/info: Screenshot taken: " << filename << " (" << img.w << "x" << img.h << ")" << std::endl;
-}
-
-
void Window::resize() {
unsigned width = m_fullscreen ? m_fsW : m_windowW;
unsigned height = m_fullscreen ? m_fsH : m_windowH;
@@ -304,7 +284,8 @@ void Window::resize() {
GLattrSetter attr_ag(SDL_GL_ACCUM_GREEN_SIZE, 0);
GLattrSetter attr_ab(SDL_GL_ACCUM_BLUE_SIZE, 0);
GLattrSetter attr_aa(SDL_GL_ACCUM_ALPHA_SIZE, 0);
- screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL | SDL_RESIZABLE | (m_fullscreen ? SDL_FULLSCREEN : 0));
+ SDL_FreeSurface(screen);
+ screen = SDL_SetVideoMode(width, height, 0, SDL_OPENGL | (m_fullscreen ? SDL_FULLSCREEN : SDL_RESIZABLE));
if (!screen) throw std::runtime_error(std::string("SDL_SetVideoMode failed: ") + SDL_GetError());
}
s_width = screen->w;
@@ -313,10 +294,27 @@ void Window::resize() {
config["graphic/window_width"].i() = s_width;
config["graphic/window_height"].i() = s_height;
}
+ // Enforce aspect ratio limits
if (s_height < 0.56f * s_width) s_width = round(s_height / 0.56f);
if (s_height > 0.8f * s_width) s_height = round(0.8f * s_width);
}
+void Window::screenshot() {
+ Image img;
+ img.w = m_fullscreen ? m_fsW : m_windowW;
+ img.h = m_fullscreen ? m_fsH : m_windowH;
+ img.data.resize(((img.w + 3) & ~3) * img.h * 3);
+ img.format = pix::RGB;
+ img.reverse = true;
+ // Get pixel data from OpenGL
+ glReadPixels(0, 0, img.w, img.h, GL_RGB, GL_UNSIGNED_BYTE, &img.data[0]);
+ // Compose filename from timestamp
+ fs::path filename = getHomeDir() / ("Performous_" + to_iso_string(boost::posix_time::second_clock::local_time()) + ".png");
+ // Save to disk
+ writePNG(filename.string(), img);
+ std::clog << "video/info: Screenshot taken: " << filename << " (" << img.w << "x" << img.h << ")" << std::endl;
+}
+
ViewTrans::ViewTrans(double offsetX, double offsetY, double frac): m_old(g_projection) {
// Setup the projection matrix for 2D translates
using namespace glmath;
diff --git a/game/video_driver.hh b/game/video_driver.hh
index c85cd8e..54b1d50 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -53,22 +53,22 @@ public:
void blank();
/// swaps buffers
void swap();
- /// resizes window to given dimensions
+ /// Handler for SDL_VIDEORESIZE event (window resized by the user)
/** @param width the new width
* @param height the new height
*/
void resize(unsigned width, unsigned height) {
- if (!m_fullscreen) { m_windowW = width; m_windowH = height; }
+ if (m_fullscreen) return; // Ignore window resize events when in fullscreen (gives bogus size on Gnome 3 and others).
+ m_windowW = width; m_windowH = height;
resize();
}
- /// does the resizing
+ /// Resize window (contents) / toggle full screen according to m_fullscreen
void resize();
/// sets fullscreen
/** @param _fs true for fullscreen
*/
void setFullscreen(bool _fs);
- /// gets fullscreen state
- bool getFullscreen() const;
+ bool getFullscreen() const { return m_fullscreen; }
/// take a screenshot
void screenshot();
|
|
From: Peque <ms...@us...> - 2011-05-29 05:30:35
|
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Sun May 29 07:29:23 2011 +0200
Fedora 15 supported for packaging
---
cmake/performous-packaging.cmake | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmake/performous-packaging.cmake b/cmake/performous-packaging.cmake
index 18f65e3..1cbb865 100644
--- a/cmake/performous-packaging.cmake
+++ b/cmake/performous-packaging.cmake
@@ -98,6 +98,9 @@ if(UNIX)
set(CPACK_PACKAGE_ARCHITECTURE amd64)
endif("${CPACK_PACKAGE_ARCHITECTURE}" MATCHES "x86_64")
# Set the dependencies based on the distro version
+ if("${LSB_DISTRIB}" MATCHES "Fedora15")
+ set(CPACK_RPM_PACKAGE_REQUIRES "gettext, gtk2, cairo, librsvg2, libsigc++20, glibmm24, libxml++, ImageMagick-c++, boost, SDL, glew, ffmpeg, pulseaudio-libs, portaudio, opencv, portmidi")
+ endif("${LSB_DISTRIB}" MATCHES "Fedora15")
if("${LSB_DISTRIB}" MATCHES "Fedora14")
set(CPACK_RPM_PACKAGE_REQUIRES "gettext, gtk2, cairo, librsvg2, libsigc++20, glibmm24, libxml++, ImageMagick-c++, boost, SDL, glew, ffmpeg, pulseaudio-libs, portaudio, opencv, portmidi")
endif("${LSB_DISTRIB}" MATCHES "Fedora14")
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-29 00:21:07
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun May 29 03:20:08 2011 +0300
Fix a bug in stereo3d.geom causing nothing to be rendered.
---
data/shaders/stereo3d.geom | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/data/shaders/stereo3d.geom b/data/shaders/stereo3d.geom
index c6522c1..0c316cb 100644
--- a/data/shaders/stereo3d.geom
+++ b/data/shaders/stereo3d.geom
@@ -26,7 +26,7 @@ void passthru() {
}
// Process all the vertices, applying code to them before emitting (do-while to convince Nvidia of the code getting executed)
-#define PROCESS(code) i = 0; do { passthru(); code; EmitVertex(); } while (++i < gl_in.length()); EndPrimitive();
+#define PROCESS(code) i = 0; do { passthru(); code; EmitVertex(); } while (++i < gl_in.length); EndPrimitive();
void main() {
bogus = 0.0;
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-27 20:29:32
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 25 04:50:40 2011 +0300
An attempt at fixing the regressions I introduced in commit c0e78b1f19ed2b25c3c37d4cf610939ef33abcab. Not tested.
---
game/ffmpeg.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a94a8b0..fd8b381 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
+ return m_posReq > 0 && m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-27 20:29:25
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 25 04:38:12 2011 +0300
Fix segfault in glGetError on Gallium3D due to a call to that being done before OpenGL context was setup.
---
game/video_driver.cc | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 7eebac7..7467d1c 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -144,7 +144,6 @@ void Window::screenshot() {
void Window::resize() {
- glutil::GLErrorChecker glerror("Window::resize");
unsigned width = m_fullscreen ? m_fsW : m_windowW;
unsigned height = m_fullscreen ? m_fsH : m_windowH;
{ // Setup GL attributes for context creation
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-27 20:27:25
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 25 04:50:40 2011 +0300
An attempt at fixing the regressions I introduced in commit c0e78b1f19ed2b25c3c37d4cf610939ef33abcab. Not tested.
---
game/ffmpeg.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a94a8b0..fd8b381 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
+ return m_posReq > 0 && m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-27 20:27:18
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 25 04:38:12 2011 +0300
Fix segfault in glGetError on Gallium3D due to a call to that being done before OpenGL context was setup.
---
game/video_driver.cc | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 21ed9ff..06e7b09 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -289,7 +289,6 @@ void Window::screenshot() {
void Window::resize() {
- glutil::GLErrorChecker glerror("Window::resize");
unsigned width = m_fullscreen ? m_fsW : m_windowW;
unsigned height = m_fullscreen ? m_fsH : m_windowH;
{ // Setup GL attributes for context creation
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-27 20:27:12
|
Author: Lasse Karkkainen <tro...@tr...> Date: Wed May 25 04:35:05 2011 +0300 Fix shaders to comply with OpenGL 2.1 (GLSL #version 120). --- data/shaders/core.frag | 6 +++--- data/shaders/core.vert | 8 ++++---- data/shaders/dancenote.vert | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/data/shaders/core.frag b/data/shaders/core.frag index f7c7e28..9f5d966 100644 --- a/data/shaders/core.frag +++ b/data/shaders/core.frag @@ -9,11 +9,11 @@ uniform mat4 colorMatrix; in float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.php?p=2401097 #endif -in vec3 normal; -in vec4 color; +varying vec3 normal; +varying vec4 color; #ifdef ENABLE_TEXTURING -in vec4 texCoord; +varying vec4 texCoord; #if ENABLE_TEXTURING == 1 uniform sampler2DRect tex; #define TEXFUNC texture2DRect(tex, texCoord.st) diff --git a/data/shaders/core.vert b/data/shaders/core.vert index ee16a3d..926ca9b 100644 --- a/data/shaders/core.vert +++ b/data/shaders/core.vert @@ -5,10 +5,10 @@ uniform mat4 positionMatrix; uniform mat3 normalMatrix; -in vec4 vertPos; -in vec4 vertTexCoord; -in vec3 vertNormal; -in vec4 vertColor; +attribute vec4 vertPos; +attribute vec4 vertTexCoord; +attribute vec3 vertNormal; +attribute vec4 vertColor; varying vec4 texCoord; varying vec4 vTexCoord; diff --git a/data/shaders/dancenote.vert b/data/shaders/dancenote.vert index 6d7df82..c9b9c92 100644 --- a/data/shaders/dancenote.vert +++ b/data/shaders/dancenote.vert @@ -8,10 +8,10 @@ uniform float clock; uniform float scale; uniform vec2 position; -in vec4 vertPos; -in vec4 vertTexCoord; -in vec3 vertNormal; -in vec4 vertColor; +attribute vec4 vertPos; +attribute vec4 vertTexCoord; +attribute vec3 vertNormal; +attribute vec4 vertColor; // Per-vextex for fragment shader (if no geometry shader) varying vec4 texCoord; |
|
From: Peque <ms...@us...> - 2011-05-25 18:56:10
|
Author: Miguel Sánchez de León Peque <msd...@gm...> Date: Wed May 25 20:55:14 2011 +0200 Forgot to update /data/performou.xpm --- data/performous.xpm | 4181 +++++++++++++++++++++++++++------------------------ 1 files changed, 2213 insertions(+), 1968 deletions(-) |
|
From: Peque <ms...@us...> - 2011-05-25 18:50:17
|
Author: Miguel Sánchez de León Peque <miguel@vostro1520.(none)>
Date: Wed May 25 20:48:24 2011 +0200
Added a border to the icon
---
themes/default/icon.bmp | Bin 4150 -> 4150 bytes
themes/default/icon.png | Bin 6692 -> 7198 bytes
themes/default/icon.svg | 42 +++++++++++++++++++++++++++++++++++++-----
win32/performous.ico | Bin 264520 -> 152126 bytes
4 files changed, 37 insertions(+), 5 deletions(-)
diff --git a/themes/default/icon.bmp b/themes/default/icon.bmp
index 94f6509..0ad4fce 100644
Binary files a/themes/default/icon.bmp and b/themes/default/icon.bmp differ
diff --git a/themes/default/icon.png b/themes/default/icon.png
index cd3b35f..cf18c84 100644
Binary files a/themes/default/icon.png and b/themes/default/icon.png differ
diff --git a/themes/default/icon.svg b/themes/default/icon.svg
index fe95e1e..bd762f7 100644
--- a/themes/default/icon.svg
+++ b/themes/default/icon.svg
@@ -74,6 +74,28 @@
stdDeviation="10.689196"
id="feGaussianBlur4104" />
</filter>
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3629-3-2"
+ id="radialGradient3049-9"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.07511259,-0.14640373,0.31280336,0.16048423,-266.7139,1057.1493)"
+ cx="727.25122"
+ cy="757.60583"
+ fx="727.25122"
+ fy="757.60583"
+ r="500" />
+ <linearGradient
+ id="linearGradient3629-3-2">
+ <stop
+ style="stop-color:#00cbff;stop-opacity:0;"
+ offset="0"
+ id="stop3631-1-6" />
+ <stop
+ style="stop-color:#0000ce;stop-opacity:1;"
+ offset="1"
+ id="stop3633-4-6" />
+ </linearGradient>
</defs>
<sodipodi:namedview
id="base"
@@ -83,15 +105,15 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6"
- inkscape:cx="36.286565"
- inkscape:cy="32.592771"
+ inkscape:cx="7.5884659"
+ inkscape:cy="34.870974"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1280"
- inkscape:window-height="725"
+ inkscape:window-height="739"
inkscape:window-x="0"
- inkscape:window-y="25"
+ inkscape:window-y="26"
inkscape:window-maximized="1" />
<metadata
id="metadata3053">
@@ -101,7 +123,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -150,5 +172,15 @@
id="rect2855-9"
inkscape:connector-curvature="0"
sodipodi:nodetypes="csscc" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1;stroke-miterlimit:4;stroke-opacity:0.17699116;stroke-dasharray:none"
+ d="m 14.578146,988.86204 c -7.7993597,0 -14.07826626,6.27896 -14.07826626,14.07836 l 0,34.8436 c 0,7.7994 6.27890656,14.0783 14.07826626,14.0783 l 34.843709,0 c 7.799365,0 14.078265,-6.2789 14.078265,-14.0783 l 0,-34.8436 c 0,-7.79939 -6.2789,-14.07835 -14.078265,-14.07835 l -34.843709,0 z"
+ id="rect2855-4"
+ inkscape:connector-curvature="0" />
+ <path
+ style="fill:none;stroke:#ffffff;stroke-width:0.99999189000000011;stroke-miterlimit:4;stroke-opacity:0.40789473;stroke-dasharray:none"
+ d="m 15.131283,989.86217 c -7.5517331,0 -13.631287,6.07961 -13.631287,13.63133 l 0,33.7373 c 0,7.5519 6.0795539,13.6314 13.631287,13.6314 l 33.737435,0 c 7.551739,0 13.631286,-6.0795 13.631286,-13.6314 l 0,-33.7373 c 0,-7.55171 -6.079547,-13.63132 -13.631286,-13.63132 l -33.737435,0 z"
+ id="rect2855-4-8"
+ inkscape:connector-curvature="0" />
</g>
</svg>
diff --git a/win32/performous.ico b/win32/performous.ico
index 2f52ed6..efe4bf8 100644
Binary files a/win32/performous.ico and b/win32/performous.ico differ
|
|
From: th3pr0ph3t <th3...@us...> - 2011-05-25 17:25:59
|
Author: Juan Montoya <th3...@gm...> Date: Wed May 25 12:23:42 2011 -0500 Added two backgrounds: guitar_bg.svg and singer_bg.svg --- data/backgrounds/guitar_bg.svg | 331 ++++++++++++++++++ data/backgrounds/singer_bg.svg | 730 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 1061 insertions(+), 0 deletions(-) |
|
From: th3pr0ph3t <th3...@us...> - 2011-05-25 17:25:51
|
Author: Juan Montoya <juan@storm.(none)>
Date: Wed May 25 12:18:03 2011 -0500
Revert "Revert "More precise timecode handling and more tolerance before seeking (workaround for infinite seekloops).""
This reverts commit d231b3f4fbd8717614d95cd7da85a9d32cc03cd0.
---
game/ffmpeg.cc | 5 +++--
game/ffmpeg.hh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 1be7d7f..e565a04 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -280,11 +280,12 @@ void FFmpeg::decodeNextFrame() {
std::vector<int16_t> resampled(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
- // Calculate new positions
+ // Use timecode from packet if available
if (packet.time() == packet.time()) m_position = packet.time();
- else m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
+ // Increment current time
+ m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
}
// Audio frames are always finished
frameFinished = 1;
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index 8006df8..a94a8b0 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return oldest > 0 && m_posReq < int64_t(oldest);
+ return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: th3pr0ph3t <th3...@us...> - 2011-05-25 17:10:21
|
Author: Juan Montoya <juan@storm.(none)>
Date: Wed May 25 09:31:02 2011 -0500
Revert "More precise timecode handling and more tolerance before seeking (workaround for infinite seekloops)."
This reverts commit c0e78b1f19ed2b25c3c37d4cf610939ef33abcab.
---
game/ffmpeg.cc | 5 ++---
game/ffmpeg.hh | 2 +-
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index e565a04..1be7d7f 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -280,12 +280,11 @@ void FFmpeg::decodeNextFrame() {
std::vector<int16_t> resampled(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
- // Use timecode from packet if available
+ // Calculate new positions
if (packet.time() == packet.time()) m_position = packet.time();
+ else m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
- // Increment current time
- m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
}
// Audio frames are always finished
frameFinished = 1;
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a94a8b0..8006df8 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
+ return oldest > 0 && m_posReq < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Yoda-JM <yo...@us...> - 2011-05-23 16:07:17
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon May 23 17:59:45 2011 +0200
Converted to boost::filesystem3
---
cmake/Modules/FindBoost.cmake | 2 +-
game/backgrounds.cc | 5 +++++
game/cache.cc | 4 ++++
game/filemagic.hh | 4 ++++
game/fs.cc | 4 ++++
game/songparser-ini.cc | 4 ++++
game/songparser.cc | 4 ++++
game/songs.cc | 5 +++++
tools/ss_helpers.hh | 4 ++++
9 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/cmake/Modules/FindBoost.cmake b/cmake/Modules/FindBoost.cmake
index 3fd02f7..4acd243 100644
--- a/cmake/Modules/FindBoost.cmake
+++ b/cmake/Modules/FindBoost.cmake
@@ -90,7 +90,7 @@ if (Boost_FOUND)
else()
# MESSAGE(STATUS "Finding Boost libraries.... ")
- SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.45" "1.44" "1.43" "1.42" "1.41" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.0" "1.36" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33")
+ SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.46" "1.45" "1.44" "1.43" "1.42" "1.41" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.0" "1.36" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33")
############################################
#
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 7fd3cd0..cdedefb 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -55,8 +55,13 @@ void Backgrounds::reload_internal(fs::path const& parent) {
for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
fs::path p = dirIt->path();
if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename
std::string path = p.directory_string(); // Path without filename
+#else
+ std::string name = p.filename().string(); // File basename
+ std::string path = p.string(); // Path without filename
+#endif
path.erase(path.size() - name.size());
if (!regex_match(name.c_str(), match, expression)) continue;
{
diff --git a/game/cache.cc b/game/cache.cc
index 69974e2..0f1edd0 100644
--- a/game/cache.cc
+++ b/game/cache.cc
@@ -9,7 +9,11 @@ namespace cache {
fs::path constructSVGCacheFileName(fs::path const& svgfilename, double factor){
fs::path cache_filename;
std::string const lod = (boost::format("%.2f") % factor).str();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string const cache_basename = svgfilename.filename() + ".cache_" + lod + ".png";
+#else
+ std::string const cache_basename = svgfilename.filename().string() + ".cache_" + lod + ".png";
+#endif
if (isThemeResource(svgfilename)) {
std::string const theme_name = (config["game/theme"].s().empty() ? "default" : config["game/theme"].s());
diff --git a/game/filemagic.hh b/game/filemagic.hh
index bf87ded..29e81fe 100644
--- a/game/filemagic.hh
+++ b/game/filemagic.hh
@@ -71,7 +71,11 @@ namespace filemagic {
// For now, just check the extension an assume it's not lying.
// Get file extension in lower case
+#if BOOST_FILESYSTEM_VERSION < 3
std::string ext = filename.extension();
+#else
+ std::string ext = filename.extension().string();
+#endif
// somehow this does not convert the extension to lower case:
//std::for_each(ext.begin(), ext.end(), static_cast<int(*)(int)>(std::tolower));
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower );
diff --git a/game/fs.cc b/game/fs.cc
index e34a784..767a7ab 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -128,7 +128,11 @@ std::string getThemePath(std::string const& filename) {
bool isThemeResource(fs::path filename){
try {
+#if BOOST_FILESYSTEM_VERSION < 3
std::string themefile = getThemePath(filename.filename());
+#else
+ std::string themefile = getThemePath(filename.filename().string());
+#endif
return themefile == filename;
} catch (...) { return false; }
}
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 38e163b..db15d79 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -104,7 +104,11 @@ void SongParser::iniParseHeader() {
// Search the dir for the music files
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename (notes.txt)
+#else
+ std::string name = p.filename().string(); // File basename (notes.txt)
+#endif
if (regex_match(name.c_str(), match, midifile)) {
s.midifilename = name;
} else if (regex_match(name.c_str(), match, audiofile_background)) {
diff --git a/game/songparser.cc b/game/songparser.cc
index 2b7b9b4..ac9f3f6 100644
--- a/game/songparser.cc
+++ b/game/songparser.cc
@@ -100,7 +100,11 @@ SongParser::SongParser(Song& s):
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename
+#else
+ std::string name = p.filename().string(); // File basename
+#endif
if (m_song.cover.empty() && regex_match(name.c_str(), match, coverfile)) {
m_song.cover = name;
} else if (m_song.background.empty() && regex_match(name.c_str(), match, backgroundfile)) {
diff --git a/game/songs.cc b/game/songs.cc
index 62ab26d..afab383 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -67,8 +67,13 @@ void Songs::reload_internal(fs::path const& parent) {
for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
fs::path p = dirIt->path();
if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename (notes.txt)
std::string path = p.directory_string(); // Path without filename
+#else
+ std::string name = p.filename().string(); // File basename (notes.txt)
+ std::string path = p.string(); // Path without filename
+#endif
path.erase(path.size() - name.size());
if (!regex_match(name.c_str(), match, expression)) continue;
try {
diff --git a/tools/ss_helpers.hh b/tools/ss_helpers.hh
index 58e19dc..8895d94 100644
--- a/tools/ss_helpers.hh
+++ b/tools/ss_helpers.hh
@@ -10,7 +10,11 @@ extern "C" void xmlLogger(void* logger, char const* msg, ...) { if (logger) *(st
void enableXMLLogger(std::ostream& os = std::cerr) { xmlSetGenericErrorFunc(&os, xmlLogger); }
void disableXMLLogger() { xmlSetGenericErrorFunc(NULL, xmlLogger); }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string filename(boost::filesystem::path const& p) { return *--p.end(); }
+#else
+std::string filename(boost::filesystem::path const& p) { return p.filename().string(); }
+#endif
/** Fix Singstar's b0rked XML **/
std::string xmlFix(std::vector<char> const& data) {
|
|
From: Yoda-JM <yo...@us...> - 2011-05-23 16:07:09
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon May 23 17:59:45 2011 +0200
Converted to boost::filesystem3
---
cmake/Modules/FindBoost.cmake | 2 +-
game/backgrounds.cc | 5 +++++
game/cache.cc | 4 ++++
game/filemagic.hh | 4 ++++
game/fs.cc | 4 ++++
game/songparser-ini.cc | 4 ++++
game/songparser.cc | 4 ++++
game/songs.cc | 5 +++++
tools/ss_helpers.hh | 4 ++++
9 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/cmake/Modules/FindBoost.cmake b/cmake/Modules/FindBoost.cmake
index 3fd02f7..4acd243 100644
--- a/cmake/Modules/FindBoost.cmake
+++ b/cmake/Modules/FindBoost.cmake
@@ -90,7 +90,7 @@ if (Boost_FOUND)
else()
# MESSAGE(STATUS "Finding Boost libraries.... ")
- SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.45" "1.44" "1.43" "1.42" "1.41" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.0" "1.36" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33")
+ SET( _boost_TEST_VERSIONS ${Boost_ADDITIONAL_VERSIONS} "1.46" "1.45" "1.44" "1.43" "1.42" "1.41" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.0" "1.36" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33")
############################################
#
diff --git a/game/backgrounds.cc b/game/backgrounds.cc
index 7fd3cd0..cdedefb 100644
--- a/game/backgrounds.cc
+++ b/game/backgrounds.cc
@@ -55,8 +55,13 @@ void Backgrounds::reload_internal(fs::path const& parent) {
for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
fs::path p = dirIt->path();
if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename
std::string path = p.directory_string(); // Path without filename
+#else
+ std::string name = p.filename().string(); // File basename
+ std::string path = p.string(); // Path without filename
+#endif
path.erase(path.size() - name.size());
if (!regex_match(name.c_str(), match, expression)) continue;
{
diff --git a/game/cache.cc b/game/cache.cc
index 69974e2..0f1edd0 100644
--- a/game/cache.cc
+++ b/game/cache.cc
@@ -9,7 +9,11 @@ namespace cache {
fs::path constructSVGCacheFileName(fs::path const& svgfilename, double factor){
fs::path cache_filename;
std::string const lod = (boost::format("%.2f") % factor).str();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string const cache_basename = svgfilename.filename() + ".cache_" + lod + ".png";
+#else
+ std::string const cache_basename = svgfilename.filename().string() + ".cache_" + lod + ".png";
+#endif
if (isThemeResource(svgfilename)) {
std::string const theme_name = (config["game/theme"].s().empty() ? "default" : config["game/theme"].s());
diff --git a/game/filemagic.hh b/game/filemagic.hh
index bf87ded..29e81fe 100644
--- a/game/filemagic.hh
+++ b/game/filemagic.hh
@@ -71,7 +71,11 @@ namespace filemagic {
// For now, just check the extension an assume it's not lying.
// Get file extension in lower case
+#if BOOST_FILESYSTEM_VERSION < 3
std::string ext = filename.extension();
+#else
+ std::string ext = filename.extension().string();
+#endif
// somehow this does not convert the extension to lower case:
//std::for_each(ext.begin(), ext.end(), static_cast<int(*)(int)>(std::tolower));
std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower );
diff --git a/game/fs.cc b/game/fs.cc
index e34a784..767a7ab 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -128,7 +128,11 @@ std::string getThemePath(std::string const& filename) {
bool isThemeResource(fs::path filename){
try {
+#if BOOST_FILESYSTEM_VERSION < 3
std::string themefile = getThemePath(filename.filename());
+#else
+ std::string themefile = getThemePath(filename.filename().string());
+#endif
return themefile == filename;
} catch (...) { return false; }
}
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 38e163b..db15d79 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -104,7 +104,11 @@ void SongParser::iniParseHeader() {
// Search the dir for the music files
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename (notes.txt)
+#else
+ std::string name = p.filename().string(); // File basename (notes.txt)
+#endif
if (regex_match(name.c_str(), match, midifile)) {
s.midifilename = name;
} else if (regex_match(name.c_str(), match, audiofile_background)) {
diff --git a/game/songparser.cc b/game/songparser.cc
index 2b7b9b4..ac9f3f6 100644
--- a/game/songparser.cc
+++ b/game/songparser.cc
@@ -100,7 +100,11 @@ SongParser::SongParser(Song& s):
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
boost::filesystem::path p = dirIt->path();
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename
+#else
+ std::string name = p.filename().string(); // File basename
+#endif
if (m_song.cover.empty() && regex_match(name.c_str(), match, coverfile)) {
m_song.cover = name;
} else if (m_song.background.empty() && regex_match(name.c_str(), match, backgroundfile)) {
diff --git a/game/songs.cc b/game/songs.cc
index 62ab26d..afab383 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -67,8 +67,13 @@ void Songs::reload_internal(fs::path const& parent) {
for (fs::directory_iterator dirIt(parent), dirEnd; m_loading && dirIt != dirEnd; ++dirIt) {
fs::path p = dirIt->path();
if (fs::is_directory(p)) { reload_internal(p); continue; }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string name = p.leaf(); // File basename (notes.txt)
std::string path = p.directory_string(); // Path without filename
+#else
+ std::string name = p.filename().string(); // File basename (notes.txt)
+ std::string path = p.string(); // Path without filename
+#endif
path.erase(path.size() - name.size());
if (!regex_match(name.c_str(), match, expression)) continue;
try {
diff --git a/tools/ss_helpers.hh b/tools/ss_helpers.hh
index 58e19dc..8895d94 100644
--- a/tools/ss_helpers.hh
+++ b/tools/ss_helpers.hh
@@ -10,7 +10,11 @@ extern "C" void xmlLogger(void* logger, char const* msg, ...) { if (logger) *(st
void enableXMLLogger(std::ostream& os = std::cerr) { xmlSetGenericErrorFunc(&os, xmlLogger); }
void disableXMLLogger() { xmlSetGenericErrorFunc(NULL, xmlLogger); }
+#if BOOST_FILESYSTEM_VERSION < 3
std::string filename(boost::filesystem::path const& p) { return *--p.end(); }
+#else
+std::string filename(boost::filesystem::path const& p) { return p.filename().string(); }
+#endif
/** Fix Singstar's b0rked XML **/
std::string xmlFix(std::vector<char> const& data) {
|
|
From: Peque <ms...@us...> - 2011-05-21 20:29:00
|
Author: Miguel Sánchez de León Peque <msd...@gm...> Date: Sat May 21 22:26:35 2011 +0200 New icon --- data/performous.xpm | 3379 +++++++++++++++++++++++++++-------------------- themes/default/icon.bmp | Bin 3126 -> 4150 bytes themes/default/icon.png | Bin 6108 -> 6692 bytes themes/default/icon.svg | 316 ++--- 4 files changed, 2077 insertions(+), 1618 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-18 15:55:47
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 18 18:52:13 2011 +0300
More precise timecode handling and more tolerance before seeking (workaround for infinite seekloops).
---
game/ffmpeg.cc | 5 +++--
game/ffmpeg.hh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 1be7d7f..e565a04 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -280,11 +280,12 @@ void FFmpeg::decodeNextFrame() {
std::vector<int16_t> resampled(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
- // Calculate new positions
+ // Use timecode from packet if available
if (packet.time() == packet.time()) m_position = packet.time();
- else m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
+ // Increment current time
+ m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
}
// Audio frames are always finished
frameFinished = 1;
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index 8006df8..a94a8b0 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return oldest > 0 && m_posReq < int64_t(oldest);
+ return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-18 15:55:40
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 18 18:52:13 2011 +0300
More precise timecode handling and more tolerance before seeking (workaround for infinite seekloops).
---
game/ffmpeg.cc | 5 +++--
game/ffmpeg.hh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 7e1d129..b92bdad 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -280,11 +280,12 @@ void FFmpeg::decodeNextFrame() {
std::vector<int16_t> resampled(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
- // Calculate new positions
+ // Use timecode from packet if available
if (packet.time() == packet.time()) m_position = packet.time();
- else m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
+ // Increment current time
+ m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
}
// Audio frames are always finished
frameFinished = 1;
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a3b4388..ed65d3f 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return oldest > 0 && m_posReq < int64_t(oldest);
+ return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-05-18 15:52:28
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Wed May 18 18:52:13 2011 +0300
More precise timecode handling and more tolerance before seeking (workaround for infinite seekloops).
---
game/ffmpeg.cc | 5 +++--
game/ffmpeg.hh | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 1be7d7f..e565a04 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -280,11 +280,12 @@ void FFmpeg::decodeNextFrame() {
std::vector<int16_t> resampled(AVCODEC_MAX_AUDIO_FRAME_SIZE);
int frames = audio_resample(pResampleCtx, &resampled[0], audioFrames, outsize);
resampled.resize(frames * AUDIO_CHANNELS);
- // Calculate new positions
+ // Use timecode from packet if available
if (packet.time() == packet.time()) m_position = packet.time();
- else m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
// Push to output queue (may block)
audioQueue.push(resampled, m_position);
+ // Increment current time
+ m_position += double(resampled.size())/double(audioQueue.getSamplesPerSecond());
}
// Audio frames are always finished
frameFinished = 1;
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index 8006df8..a94a8b0 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -162,7 +162,7 @@ class AudioBuffer {
void setDuration(double seconds) { m_duration = seconds; }
bool wantSeek() {
size_t oldest = m_pos - m_data.size();
- return oldest > 0 && m_posReq < int64_t(oldest);
+ return m_posReq + int64_t(m_sps) * 2.0 /* seconds tolerance */ < int64_t(oldest);
}
private:
bool wantMore() { return int64_t(m_pos) - int64_t(m_data.capacity() / 2) < m_posReq; }
|
|
From: Tapio V. <aa...@us...> - 2011-05-13 12:21:08
|
Author: Tapio Vierros <tap...@gm...> Date: Fri May 13 15:20:32 2011 +0300 Fixed song download links. --- htdocs-source/songs.txt | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs-source/songs.txt b/htdocs-source/songs.txt index 059e21d..4a7ba22 100644 --- a/htdocs-source/songs.txt +++ b/htdocs-source/songs.txt @@ -16,7 +16,7 @@ The songs here are only repackaged by the Performous project. The packages conta The <strong>libre</strong> package contains songs with very permissive licenses. <strong>Free Software Song</strong> by Thor <strong>On the run</strong> by Joshua Morin - Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-libre/ultrastar-songs-libre-3.zip/download" target="_new">ZIP</a> (5 MB) + Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-libre/3/ultrastar-songs-libre-3.zip/download" target="_new">ZIP</a> (5 MB) </div> :>div,~margin @@ -26,7 +26,7 @@ The songs here are only repackaged by the Performous project. The packages conta <strong>I 18</strong> by Dead Smiling Pirates <strong>Northern Star</strong> by Steven Dunston <strong>Space Invaders</strong> by Pornophonique - Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-restricted/ultrastar-songs-restricted-3.zip/download" target="_new">ZIP</a> (10 MB) + Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-restricted/3/ultrastar-songs-restricted-3.zip/download" target="_new">ZIP</a> (10 MB) </div> :>div,~margin @@ -57,7 +57,7 @@ The songs here are only repackaged by the Performous project. The packages conta <strong>That Spells DNA</strong> <strong>The Future Soon</strong> <strong>When You Go</strong> - Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-jc/ultrastar-songs-jc-1.zip/download" target="_new">ZIP</a> (240 MB) + Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-jc/1/ultrastar-songs-jc-1.zip/download" target="_new">ZIP</a> (240 MB) </div> :>div,~margin @@ -69,7 +69,7 @@ The songs here are only repackaged by the Performous project. The packages conta <strong>In My Hand</strong> <strong>Man Song</strong> (with karaoke) <strong>Stay with me</strong> (with karaoke) - Download <a href="http://sourceforge.net/projects/performous/files/ultrastar-songs-shearer/ultrastar-songs-shearer-1.zip/download" target="_new">ZIP</a> (50 MB) + Download <a href="https://sourceforge.net/projects/performous/files/ultrastar-songs-shearer/1/ultrastar-songs-shearer-1.zip/download" target="_new">ZIP</a> (50 MB) </div> |
|
From: Yoda-JM <yo...@us...> - 2011-05-08 16:57:19
|
Author: Tapio Vierros <tap...@gm...>
Date: Tue Mar 1 23:54:51 2011 +0200
Add quite a few missing const-qualifiers.
---
game/database.hh | 2 +-
game/ffmpeg.cc | 2 +-
game/ffmpeg.hh | 2 +-
game/joystick.hh | 14 +++++++-------
game/layout_singer.cc | 2 +-
game/layout_singer.hh | 2 +-
game/midifile.cc | 2 +-
game/opengl_text.hh | 8 ++++----
game/songparser-ini.cc | 2 +-
game/songparser-sm.cc | 2 +-
game/songparser-txt.cc | 2 +-
game/songparser.hh | 6 +++---
game/video_driver.cc | 2 +-
game/video_driver.hh | 2 +-
game/webcam.hh | 2 +-
15 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/game/database.hh b/game/database.hh
index 44f30fa..819f7ff 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -15,7 +15,7 @@ struct ScoreItem {
std::string track; // includes difficulty
std::string track_simple; // no difficulty
Color color;
- bool operator < (ScoreItem const& other) { return score < other.score; }
+ bool operator < (ScoreItem const& other) const { return score < other.score; }
};
/**Access to a database for performous which holds
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index 7e1d129..1be7d7f 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -18,7 +18,7 @@ extern "C" {
/*static*/ boost::mutex FFmpeg::s_avcodec_mutex;
FFmpeg::FFmpeg(bool _decodeVideo, bool _decodeAudio, std::string const& _filename, unsigned int rate):
- m_filename(_filename), m_rate(rate), m_quit(), m_running(), m_eof(), m_seekTarget(getNaN()),
+ width(), height(), m_filename(_filename), m_rate(rate), m_quit(), m_running(), m_eof(), m_seekTarget(getNaN()),
pFormatCtx(), pResampleCtx(), img_convert_ctx(), pVideoCodecCtx(), pAudioCodecCtx(), pVideoCodec(), pAudioCodec(),
videoStream(-1), audioStream(-1), decodeVideo(_decodeVideo), decodeAudio(_decodeAudio), m_position(),
m_thread(new boost::thread(boost::ref(*this)))
diff --git a/game/ffmpeg.hh b/game/ffmpeg.hh
index a3b4388..8006df8 100644
--- a/game/ffmpeg.hh
+++ b/game/ffmpeg.hh
@@ -125,7 +125,7 @@ class AudioBuffer {
/// set samples per second
void setSamplesPerSecond(unsigned sps) { m_sps = sps; }
/// get samples per second
- unsigned getSamplesPerSecond() { return m_sps; }
+ unsigned getSamplesPerSecond() const { return m_sps; }
void push(std::vector<int16_t> const& data, double timestamp) {
boost::mutex::scoped_lock l(m_mutex);
while (!condition()) m_cond.wait(l);
diff --git a/game/joystick.hh b/game/joystick.hh
index 83623ee..44f82b8 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -113,13 +113,13 @@ namespace input {
m_pressed[i] = _event.pressed[i];
}
};
- void clearEvents() {m_events.clear();};
- void assign() {m_assigned = true;};
- void unassign() {m_assigned = false; clearEvents();};
- bool assigned() {return m_assigned;};
- bool pressed(int _button) {return m_pressed[_button];};
- std::string name() {return m_instrument.name;};
- bool type_match(DevType _type) {
+ void clearEvents() { m_events.clear(); }
+ void assign() { m_assigned = true; }
+ void unassign() { m_assigned = false; clearEvents(); }
+ bool assigned() const { return m_assigned; }
+ bool pressed(int _button) const { return m_pressed[_button]; }
+ std::string name() const { return m_instrument.name; }
+ bool type_match(DevType _type) const {
return _type == m_instrument.type;
};
int buttonFromSDL(unsigned int sdl_button) {
diff --git a/game/layout_singer.cc b/game/layout_singer.cc
index 625a824..09eac21 100644
--- a/game/layout_singer.cc
+++ b/game/layout_singer.cc
@@ -151,6 +151,6 @@ void LayoutSinger::draw(double time, Position position) {
if (!config["game/karaoke_mode"].b() ) drawScore(position); // draw score if not in karaoke mode
}
-double LayoutSinger::lyrics_begin() {
+double LayoutSinger::lyrics_begin() const {
return m_lyricit->begin;
}
diff --git a/game/layout_singer.hh b/game/layout_singer.hh
index b4f1b8f..1529aea 100644
--- a/game/layout_singer.hh
+++ b/game/layout_singer.hh
@@ -56,7 +56,7 @@ class LayoutSinger {
void reset();
void draw(double time, Position position = LayoutSinger::BOTTOM);
void drawScore(Position position);
- double lyrics_begin();
+ double lyrics_begin() const;
void hideLyrics(bool hide = true) { m_hideLyrics = hide; };
private:
VocalTrack& m_vocal;
diff --git a/game/midifile.cc b/game/midifile.cc
index 5272165..cb1c735 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -45,7 +45,7 @@ class MidiStream {
size_t offset;
Riff(MidiStream& ms);
~Riff();
- bool has_more_data() { return offset < size; }
+ bool has_more_data() const { return offset < size; }
uint8_t read_uint8() { consume(1); return ms.f.get(); }
uint16_t read_uint16() { consume(2); return ms.read_uint16(); }
uint32_t read_uint32() { consume(4); return ms.read_uint32(); }
diff --git a/game/opengl_text.hh b/game/opengl_text.hh
index 01847d7..9d96f93 100644
--- a/game/opengl_text.hh
+++ b/game/opengl_text.hh
@@ -49,13 +49,13 @@ class OpenGLText {
/// draws full texture
void draw();
/// @return x
- double x() {return m_x;};
+ double x() const { return m_x; }
/// @return y
- double y() {return m_y;};
+ double y() const { return m_y; }
/// @return x_advance
- double x_advance() {return m_x_advance;};
+ double x_advance() const { return m_x_advance; }
/// @return y_advance
- double y_advance() {return m_y_advance;};
+ double y_advance() const { return m_y_advance; }
/// @returns dimension of texture
Dimensions& dimensions() { return m_surface.dimensions; }
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 36e724b..38e163b 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -12,7 +12,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::iniCheck(std::vector<char> const& data) {
+bool SongParser::iniCheck(std::vector<char> const& data) const {
static const std::string header = "[song]";
return std::equal(header.begin(), header.end(), data.begin());
}
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index cb84732..a006b60 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -12,7 +12,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::smCheck(std::vector<char> const& data) {
+bool SongParser::smCheck(std::vector<char> const& data) const {
if (data[0] != '#' || data[1] < 'A' || data[1] > 'Z') return false;
for (std::vector<char>::const_iterator it = data.begin(); it != data.end(); ++it){
if (*it == '\n') return false;
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 856ff9f..06221b3 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -11,7 +11,7 @@
using namespace SongParserUtil;
/// 'Magick' to check if this file looks like correct format
-bool SongParser::txtCheck(std::vector<char> const& data) {
+bool SongParser::txtCheck(std::vector<char> const& data) const {
return data[0] == '#' && data[1] >= 'A' && data[1] <= 'Z';
}
diff --git a/game/songparser.hh b/game/songparser.hh
index 601fbce..4232731 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -32,15 +32,15 @@ class SongParser {
double m_gap;
double m_bpm;
- bool txtCheck(std::vector<char> const& data);
+ bool txtCheck(std::vector<char> const& data) const;
void txtParseHeader();
void txtParse();
bool txtParseField(std::string const& line);
bool txtParseNote(std::string line, VocalTrack &vocal);
- bool iniCheck(std::vector<char> const& data);
+ bool iniCheck(std::vector<char> const& data) const;
void iniParseHeader();
void iniParse();
- bool smCheck(std::vector<char> const& data);
+ bool smCheck(std::vector<char> const& data) const;
void smParseHeader();
void smParse();
bool smParseField(std::string line);
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 4471648..21ed9ff 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -267,7 +267,7 @@ void Window::setFullscreen(bool _fs) {
resize();
}
-bool Window::getFullscreen() {
+bool Window::getFullscreen() const {
return m_fullscreen;
}
diff --git a/game/video_driver.hh b/game/video_driver.hh
index 3b5bd2d..c85cd8e 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -68,7 +68,7 @@ public:
*/
void setFullscreen(bool _fs);
/// gets fullscreen state
- bool getFullscreen();
+ bool getFullscreen() const;
/// take a screenshot
void screenshot();
diff --git a/game/webcam.hh b/game/webcam.hh
index 9566f2e..33e4358 100644
--- a/game/webcam.hh
+++ b/game/webcam.hh
@@ -30,7 +30,7 @@ class Webcam {
void operator()();
/// Is good?
- bool is_good() { return m_capture != 0 && m_running; }
+ bool is_good() const { return m_capture != 0 && m_running; }
/// When paused, does not get or render frames
void pause(bool do_pause = true);
/// Display frame
|
|
From: Yoda-JM <yo...@us...> - 2011-05-08 16:46:56
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Feb 27 00:39:30 2011 +0100
Build fix
---
game/CMakeLists.txt | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 3a34f6b..0482c8e 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -123,8 +123,9 @@ if(APPLE)
endif(APPLE)
if(UNIX)
- list(APPEND CMAKE_CXX_FLAGS -pthread)
- list(APPEND CMAKE_EXE_LINKER_FLAGS -pthread)
+ # Note: cannot use list APPEND here because it inserts semicolons instead of spaces
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
endif(UNIX)
if(MSVC)
|
|
From: Yoda-JM <yo...@us...> - 2011-05-07 16:38:33
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Mar 29 00:43:59 2011 +0200
Less copypasta, more beef.
---
game/configuration.cc | 36 ++++++++----------------------------
1 files changed, 8 insertions(+), 28 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index 9d383ff..3f6144d 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -171,6 +171,9 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (mode == 0) {
m_type = getAttribute(elem, "type");
if (m_type.empty()) throw std::runtime_error("Entry type attribute is missing");
+ // Menu text
+ m_shortDesc = getText(elem, "short");
+ m_longDesc = getText(elem, "long");
} else {
std::string type = getAttribute(elem, "type");
if (!type.empty() && type != m_type) throw std::runtime_error("Entry type mismatch: " + getAttribute(elem, "name") + ": schema type = " + m_type + ", config type = " + type);
@@ -191,7 +194,7 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (!n2.empty()) {
for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
xmlpp::Element& elem2 = dynamic_cast<xmlpp::Element&>(**it2);
- m_enums.push_back(elem2.get_child_text()->get_content());
+ m_enums.push_back(getText(elem2));
}
m_min = 0;
m_max = int(m_enums.size() - 1);
@@ -204,40 +207,17 @@ void ConfigItem::update(xmlpp::Element& elem, int mode) try {
if (!value_string.empty()) m_value = boost::lexical_cast<double>(value_string);
updateNumeric<double>(elem, mode);
} else if (m_type == "string") {
- xmlpp::NodeSet n2 = elem.find("stringvalue/text()");
- // FIXME: WTF does this loop do? Does find actually return many elements and why?
- std::string value;
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- value = elem2.get_content();
- }
- m_value = value;
+ m_value = getText(elem, "stringvalue");
} else if (m_type == "string_list" || m_type == "option_list") {
//TODO: Option list should also update selection (from attribute?)
std::vector<std::string> value;
- xmlpp::NodeSet n2 = elem.find("stringvalue/text()");
+ xmlpp::NodeSet n2 = elem.find("stringvalue");
for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- value.push_back(elem2.get_content());
+ value.push_back(getText(dynamic_cast<xmlpp::Element const&>(**it2)));
}
m_value = value;
} else if (!m_type.empty()) throw std::runtime_error("Invalid value type in config schema: " + m_type);
- {
- // Update short description
- xmlpp::NodeSet n2 = elem.find("short/text()");
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- m_shortDesc = elem2.get_content();
- }
- }
- {
- // Update long description
- xmlpp::NodeSet n2 = elem.find("long/text()");
- for (xmlpp::NodeSet::const_iterator it2 = n2.begin(), end2 = n2.end(); it2 != end2; ++it2) {
- xmlpp::TextNode& elem2 = dynamic_cast<xmlpp::TextNode&>(**it2);
- m_longDesc = elem2.get_content();
- }
- }
+ // Schema sets all defaults, system config sets the system default
if (mode < 1) m_factoryDefaultValue = m_defaultValue = m_value;
if (mode < 2) m_defaultValue = m_value;
} catch (std::exception& e) {
|