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: sajjadG <sa...@us...> - 2011-08-01 18:22:05
|
Author: sajjadg <saj...@gm...> Date: Mon Aug 1 18:47:25 2011 -0400 This is the Persian language translation. fa is for farsi the locale name for language --- lang/fa.po | 565 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 565 insertions(+), 0 deletions(-) |
|
From: Dario E. <ne...@us...> - 2011-07-30 13:50:42
|
Author: Dario Ernst <da...@ne...>
Date: Sat Jul 30 15:23:17 2011 +0200
endphrase feature maybe works a little by now
---
editor.ui | 16 ++++++++++--
editorapp.cc | 1 +
notegraphwidget.cc | 62 ++++++++++++++++++++++++++++++++++++++++++++++++--
notegraphwidget.hh | 7 +++++
notelabelmanager.cc | 12 ++++++++++
5 files changed, 92 insertions(+), 6 deletions(-)
diff --git a/editor.ui b/editor.ui
index 49333b6..13c4fe5 100644
--- a/editor.ui
+++ b/editor.ui
@@ -58,8 +58,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>219</width>
- <height>89</height>
+ <width>217</width>
+ <height>87</height>
</rect>
</property>
</widget>
@@ -269,6 +269,16 @@
</property>
</widget>
</item>
+ <item row="3" column="1">
+ <widget class="QPushButton" name="cmdEndSentence">
+ <property name="text">
+ <string>End Phrase (E)</string>
+ </property>
+ <property name="shortcut">
+ <string>E</string>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<widget class="QWidget" name="tabSong">
@@ -380,7 +390,7 @@
<x>0</x>
<y>0</y>
<width>800</width>
- <height>25</height>
+ <height>23</height>
</rect>
</property>
<widget class="QMenu" name="menuFile">
diff --git a/editorapp.cc b/editorapp.cc
index 3dbe4ce..9ee39d1 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -149,6 +149,7 @@ void EditorApp::setupNoteGraph()
connect(ui.actionCopy, SIGNAL(triggered()), noteGraph, SLOT(copy()));
connect(ui.actionPaste, SIGNAL(triggered()), noteGraph, SLOT(paste()));
connect(ui.cmdTimeSentence, SIGNAL(pressed()), noteGraph, SLOT(timeSentence()));
+ connect(ui.cmdEndSentence, SIGNAL(pressed()), noteGraph, SLOT(timeSentenceEnd()));
connect(ui.cmdSkipSentence, SIGNAL(pressed()), noteGraph, SLOT(selectNextSentenceStart()));
connect(ui.chkGrabSeekHandle, SIGNAL(toggled(bool)), noteGraph, SLOT(setSeekHandleWrapToViewport(bool)));
connect(ui.cmdMusicFile, SIGNAL(clicked()), this, SLOT(on_actionMusicFile_triggered()));
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index ad4d4ea..65aa0f6 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -29,6 +29,9 @@ namespace {
/*static*/ const int NoteGraphWidget::Height = 768;
/*static*/ const QString NoteGraphWidget::BGColor = "#222";
+int NoteGraphWidget::LastNoteBegin = 0;
+NoteGraphWidget::TimingEvent NoteGraphWidget::LastTimingEvent;
+
NoteGraphWidget::NoteGraphWidget(QWidget *parent)
: NoteLabelManager(parent), m_mouseHotSpot(), m_seeking(), m_actionHappened(),
m_pitch(), m_seekHandle(this), m_nextNotePixmap(), m_notePixmapTimer(), m_analyzeTimer(), m_playbackTimer(), m_playbackPos(), m_pixmap(), m_pixmapPos()
@@ -53,6 +56,7 @@ NoteGraphWidget::NoteGraphWidget(QWidget *parent)
qRegisterMetaType<QImage>("QImage"); // Needed for queued connections from other threads
updateNotes();
+ LastTimingEvent = NOEV;
}
@@ -333,26 +337,78 @@ void NoteGraphWidget::seek(int x)
void NoteGraphWidget::timeCurrent()
{
if (selectedNote()) {
- Operation op("MOVE");
+ Operation op("MOVE");
double begin = px2s(m_seekHandle.curx());
double end = px2s(m_seekHandle.curx() + selectedNote()->width());
int n = selectedNote()->note().note;
if (m_pitch) n = m_pitch->guessNote(begin, end, n);
op << getNoteLabelId(selectedNote()) << begin << end << n;
doOperation(op);
+ printf("==> timeCurrent(), moved selected from %f<->%f\n",begin,end);
}
}
void NoteGraphWidget::timeSyllable()
{
+ printf("== timeSyllable()\n");
+ LastTimingEvent = NOEV;
+ LastNoteBegin = 0;
timeCurrent();
selectNextSyllable();
+ printf("|| timeSyllable()\n");
}
void NoteGraphWidget::timeSentence()
{
- timeCurrent();
- selectNextSentenceStart();
+ printf("== timeSentence() -- LastTimingEvent: %i, LastNoteBegin: %f\n",LastTimingEvent,px2s(LastNoteBegin));
+ if (selectedNote())
+ if(LastTimingEvent == BEGIN) {
+ printf("\tLastTimingEvent == BEGIN\n");
+ selectNextSentenceStart();
+ timeCurrent();
+ } else {
+ printf("\tLastTimingEvent != BEGIN\n");
+ LastNoteBegin = m_seekHandle.curx();
+ }
+ LastTimingEvent = BEGIN;
+ printf("|| timeSentence() -- LastTimingEvent: %i, LastNoteBegin: %f\n",LastTimingEvent,px2s(LastNoteBegin));
+}
+
+void NoteGraphWidget::timeSentenceEnd()
+{
+ printf("== timeSentenceEnd() -- LastTimingEvent: %i, LastNoteBegin: %f\n",LastTimingEvent,px2s(LastNoteBegin));
+ if (selectedNote() && LastTimingEvent == BEGIN) {
+ printf("\tLastTimingEvent==BEGIN\n");
+
+ Operation op("MOVE");
+ double begin = px2s(LastNoteBegin);
+ double end = px2s(LastNoteBegin + selectedNote()->width());
+ int n = selectedNote()->note().note;
+ if (m_pitch) n = m_pitch->guessNote(begin, end, n);
+ op << getNoteLabelId(selectedNote()) << begin << end << n;
+ doOperation(op);
+ printf("\tmoved old sentence first note %f<->%f\n",begin,end);
+
+ selectNextSentenceOffset(-1);
+
+ Operation op2("MOVE");
+ begin = px2s(m_seekHandle.curx() - selectedNote()->width());
+ end = px2s(m_seekHandle.curx());
+ n = selectedNote()->note().note;
+ if (m_pitch) n = m_pitch->guessNote(begin, end, n);
+ op2 << getNoteLabelId(selectedNote()) << begin << end << n;
+ doOperation(op2);
+ printf("\tmoved old sentence last note %f<->%f\n",begin,end);
+
+
+
+ selectNextSentenceStart();
+ timeCurrent();
+
+ LastNoteBegin = 0;
+ LastTimingEvent = END;
+ }
+ printf("|| timeSentenceEnd() -- LastTimingEvent: %i, LastNoteBegin: %f\n",LastTimingEvent,px2s(LastNoteBegin));
}
void NoteGraphWidget::mousePressEvent(QMouseEvent *event)
diff --git a/notegraphwidget.hh b/notegraphwidget.hh
index 6b770ca..b639235 100644
--- a/notegraphwidget.hh
+++ b/notegraphwidget.hh
@@ -78,6 +78,7 @@ signals:
public slots:
void selectNextSyllable(bool backwards = false, bool addToSelection = false);
void selectNextSentenceStart();
+ void selectNextSentenceOffset(int offset);
void cut();
void copy();
@@ -131,6 +132,8 @@ public slots:
void showContextMenu(const QPoint &pos);
void timeSyllable();
void timeSentence();
+ void timeSentenceEnd();
+
void setSeekHandleWrapToViewport(bool state) { m_seekHandle.wrapToViewport = state; }
void updatePixmap(const QImage &image, const QPoint &position);
void updatePitch();
@@ -172,6 +175,10 @@ private:
qint64 m_playbackPos;
QPixmap m_pixmap;
QPoint m_pixmapPos;
+
+ static int LastNoteBegin;
+ enum TimingEvent {NOEV,BEGIN, END};
+ static TimingEvent LastTimingEvent;
};
diff --git a/notelabelmanager.cc b/notelabelmanager.cc
index 0a94b63..f5a920c 100644
--- a/notelabelmanager.cc
+++ b/notelabelmanager.cc
@@ -128,6 +128,18 @@ void NoteLabelManager::selectNextSentenceStart()
}
}
+void NoteLabelManager::selectNextSentenceOffset(int offset)
+{
+ // Start looking for the sentance start from the next NoteLabel, then walk <offset>
+ for (int i = getNoteLabelId(selectedNote()) + 1; i < m_notes.size(); ++i) {
+ if (m_notes[i]->note().lineBreak) {
+ selectNote(m_notes[i+offset]);
+ return;
+ }
+ }
+}
+
+
QScrollArea* NoteLabelManager::getScrollArea() const
{
if (!parentWidget()) return NULL;
|
|
From: Yoda-JM <yo...@us...> - 2011-07-24 20:07:08
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Jul 24 22:06:42 2011 +0200
Fixed compilation for old glew versions but enables compilation on Ubuntu anyway
---
game/video_driver.cc | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 6a92ce1..1e8935a 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -12,6 +12,25 @@
#include <fstream>
#include <SDL.h>
+#ifndef GLEW_ARB_viewport_array
+# define GLEW_ARB_viewport_array GL_FALSE
+# define glViewportIndexedf(index, x, y, w, h) {}
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+#ifndef GLEW_VERSION_3_3
+# define GLEW_VERSION_3_3 GL_FALSE
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+#ifndef GLEW_VERSION_4_1
+# define GLEW_VERSION_4_1 GL_FALSE
+# warning "Your version of GLEW is too old, Performous is smart and let you compile it anyway"
+#endif
+
+/*
+/home/yoda/performous/game/video_driver.cc: In member function âid Window::render(boost::function<void()>)â/home/yoda/performous/game/video_driver.cc:193:43: error: âViewportIndexedfâas not declared in this scope
+/home/yoda/performous/game/video_driver.cc: In member function âid Window::view(unsigned int)â/home/yoda/performous/game/video_driver.cc:256:46: error: âViewportIndexedfâas not declared in this scope
+*/
+
namespace {
unsigned s_width;
|
|
From: Darkmagister <dar...@us...> - 2011-07-20 22:05:43
|
Author: Federico Pietta <f.p...@gm...>
Date: Thu Jul 21 00:03:10 2011 +0200
Update Debian dependences
---
cmake/performous-packaging.cmake | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/cmake/performous-packaging.cmake b/cmake/performous-packaging.cmake
index 1cbb865..0327ebe 100644
--- a/cmake/performous-packaging.cmake
+++ b/cmake/performous-packaging.cmake
@@ -68,11 +68,11 @@ if(UNIX)
# Debian
if("${LSB_DISTRIB}" MATCHES "Debian5.*")
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-dev, libavcodec51, libavformat52, libswscale0, libmagick++10, libxml++2.6-2, libglew1.5")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.42.0, libboost-program-options1.42.0, libboost-regex1.42.0, libboost-filesystem1.42.0, libboost-date-time1.42.0, libavcodec51, libavformat52, libswscale0, libmagick++10, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
endif("${LSB_DISTRIB}" MATCHES "Debian5.*")
if("${LSB_DISTRIB}" MATCHES "Debiantesting")
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-dev, libavcodec52, libavformat52, libswscale0, libmagick++3, libxml++2.6-2, libglew1.5")
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl1.2debian, libcairo2, librsvg2-2, libboost-thread1.46.1, libboost-program-options1.46.1, libboost-regex1.46.1, libboost-filesystem1.46.1, libboost-date-time1.46.1, libavcodec52, libavformat52, libswscale0, libmagick++3, libxml++2.6-2, libglew1.5, libpng12-0, libjpeg62, libportmidi0, libcv2.1, libhighgui2.1")
endif("${LSB_DISTRIB}" MATCHES "Debiantesting")
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
|
|
From: Yoda-JM <yo...@us...> - 2011-07-20 19:34:12
|
Author: Tapio Vierros <tap...@gm...> Date: Sat Jul 2 18:45:30 2011 +0300 Fixed audio devices screen background image. --- themes/default/audiodevices_bg.svg | 196 ++---------------------------------- 1 files changed, 8 insertions(+), 188 deletions(-) |
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Jul 8 11:20:59 2011 +0300
Enable sRGB framebuffer and textures for proper gamma-correct blending (if sRGB is available), glColor values need to be made darker now. Using floating-point linear formats in FBOs.
---
game/fbo.hh | 4 ++--
game/surface.cc | 7 ++++---
game/video_driver.cc | 1 +
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/fbo.hh b/game/fbo.hh
index f3773bd..856695a 100644
--- a/game/fbo.hh
+++ b/game/fbo.hh
@@ -11,11 +11,11 @@ class FBO: boost::noncopyable {
FBO(unsigned w, unsigned h) {
{
UseTexture tex(m_texture);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_FLOAT, NULL);
}
{
UseTexture tex(m_depth);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT24, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
}
// Create FBO
glGenFramebuffersEXT(1, &m_fbo);
diff --git a/game/surface.cc b/game/surface.cc
index d24ca16..5b7078b 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -79,6 +79,7 @@ namespace {
if (it != pixFormats.m.end()) return it->second;
throw std::logic_error("Unknown pixel format");
}
+ GLint internalFormat() { return GL_EXT_framebuffer_sRGB ? GL_SRGB_ALPHA : GL_RGBA; }
}
void Texture::load(unsigned int width, unsigned int height, pix::Format format, unsigned char const* buffer, float ar) {
@@ -103,7 +104,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
// Load the data into texture
if ((isPow2(width) && isPow2(height)) || GLEW_ARB_texture_non_power_of_two) { // Can directly load the texture
- glTexImage2D(type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
} else {
int newWidth = prevPow2(width);
int newHeight = prevPow2(height);
@@ -114,7 +115,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
// (1) no repeat => cannot texture
// (2) coordinates not normalized => would require special hackery elsewhere
// Just don't do it in Surface class, thanks. -Tronic
- glTexImage2D(type(), 0, GL_RGBA, newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
+ glTexImage2D(type(), 0, internalFormat(), newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
}
glGenerateMipmap(type());
}
@@ -129,7 +130,7 @@ void Surface::load(unsigned int width, unsigned int height, pix::Format format,
UseTexture texture(m_texture);
PixFmt const& f = getPixFmt(format);
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
- glTexImage2D(m_texture.type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(m_texture.type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
}
void Surface::draw() const {
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 568e219..6a92ce1 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -244,6 +244,7 @@ void Window::view(unsigned num) {
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND);
+ if (GL_EXT_framebuffer_sRGB) glEnable(GL_FRAMEBUFFER_SRGB);
shader("color").bind();
// Setup views
double vx = 0.5f * (screen->w - s_width);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-08 05:21:27
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Jul 8 11:20:59 2011 +0300
Enable sRGB framebuffer and textures for proper gamma-correct blending (if sRGB is available), glColor values need to be made darker now. Using floating-point linear formats in FBOs.
---
game/fbo.hh | 4 ++--
game/surface.cc | 7 ++++---
game/video_driver.cc | 1 +
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/game/fbo.hh b/game/fbo.hh
index f3773bd..856695a 100644
--- a/game/fbo.hh
+++ b/game/fbo.hh
@@ -11,11 +11,11 @@ class FBO: boost::noncopyable {
FBO(unsigned w, unsigned h) {
{
UseTexture tex(m_texture);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_FLOAT, NULL);
}
{
UseTexture tex(m_depth);
- glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT24, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
+ glTexImage2D(GL_TEXTURE_RECTANGLE, 0, GL_DEPTH_COMPONENT, w, h, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL);
}
// Create FBO
glGenFramebuffersEXT(1, &m_fbo);
diff --git a/game/surface.cc b/game/surface.cc
index d24ca16..5b7078b 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -79,6 +79,7 @@ namespace {
if (it != pixFormats.m.end()) return it->second;
throw std::logic_error("Unknown pixel format");
}
+ GLint internalFormat() { return GL_EXT_framebuffer_sRGB ? GL_SRGB_ALPHA : GL_RGBA; }
}
void Texture::load(unsigned int width, unsigned int height, pix::Format format, unsigned char const* buffer, float ar) {
@@ -103,7 +104,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
// Load the data into texture
if ((isPow2(width) && isPow2(height)) || GLEW_ARB_texture_non_power_of_two) { // Can directly load the texture
- glTexImage2D(type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
} else {
int newWidth = prevPow2(width);
int newHeight = prevPow2(height);
@@ -114,7 +115,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
// (1) no repeat => cannot texture
// (2) coordinates not normalized => would require special hackery elsewhere
// Just don't do it in Surface class, thanks. -Tronic
- glTexImage2D(type(), 0, GL_RGBA, newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
+ glTexImage2D(type(), 0, internalFormat(), newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
}
glGenerateMipmap(type());
}
@@ -129,7 +130,7 @@ void Surface::load(unsigned int width, unsigned int height, pix::Format format,
UseTexture texture(m_texture);
PixFmt const& f = getPixFmt(format);
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
- glTexImage2D(m_texture.type(), 0, GL_RGBA, width, height, 0, f.format, f.type, buffer);
+ glTexImage2D(m_texture.type(), 0, internalFormat(), width, height, 0, f.format, f.type, buffer);
}
void Surface::draw() const {
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 568e219..6a92ce1 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -244,6 +244,7 @@ void Window::view(unsigned num) {
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glShadeModel(GL_SMOOTH);
glEnable(GL_BLEND);
+ if (GL_EXT_framebuffer_sRGB) glEnable(GL_FRAMEBUFFER_SRGB);
shader("color").bind();
// Setup views
double vx = 0.5f * (screen->w - s_width);
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-07 02:33:34
|
Author: Lasse Karkkainen <tro...@tr...> Date: Thu Jul 7 08:32:56 2011 +0300 Hack better guitar note lighting (eyecandy). Matrix system WIP and loading screens b0rked for now. --- data/shaders/core.frag | 30 +++++++++++++++++++++++++----- data/shaders/core.vert | 12 ++++++++++-- data/shaders/dancenote.vert | 5 +++-- data/shaders/stereo3d.geom | 3 +++ game/guitargraph.cc | 3 ++- game/video_driver.cc | 42 +++++++++++++++++++++++------------------- game/video_driver.hh | 4 +++- 7 files changed, 69 insertions(+), 30 deletions(-) diff --git a/data/shaders/core.frag b/data/shaders/core.frag index 9f5d966..6188127 100644 --- a/data/shaders/core.frag +++ b/data/shaders/core.frag @@ -12,6 +12,10 @@ in float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.ph varying vec3 normal; varying vec4 color; +#ifdef ENABLE_LIGHTING +varying vec3 lightDir; +#endif + #ifdef ENABLE_TEXTURING varying vec4 texCoord; #if ENABLE_TEXTURING == 1 @@ -41,13 +45,29 @@ void main() { #endif #ifdef ENABLE_LIGHTING - vec3 lightDir = normalize(vec3(-50.0, 5.0, -15.0)); - const vec3 ambient = vec3(0.1, 0.1, 0.1); + vec3 n = normalize(normal); + vec3 l = normalize(lightDir); + + // Diffuse + float diff = max(dot(n, l), 0.0); + float power = 1.0 - 0.02 * length(lightDir); + frag = vec4(frag.rgb * power * diff, frag.a); + +#endif + + frag = colorMatrix * frag; // Colorize + +#ifdef ENABLE_LIGHTING - float NdotL = max(dot(normalize(normal), lightDir), 0.0); - frag = vec4(ambient + frag.rgb * NdotL, frag.a); + // Specular + vec3 refl = reflect(-l, n); + float spec = dot(refl, n); + if (power > 0.0) { + power *= pow(spec, 100); + frag.rgb += vec3(power, power, power); + } #endif - gl_FragColor = colorMatrix * frag; + gl_FragColor = frag; } diff --git a/data/shaders/core.vert b/data/shaders/core.vert index 926ca9b..5b06c4a 100644 --- a/data/shaders/core.vert +++ b/data/shaders/core.vert @@ -2,7 +2,8 @@ //DEFINES -uniform mat4 positionMatrix; +uniform mat4 projMatrix; +uniform mat4 mvMatrix; uniform mat3 normalMatrix; attribute vec4 vertPos; @@ -10,6 +11,8 @@ attribute vec4 vertTexCoord; attribute vec3 vertNormal; attribute vec4 vertColor; +varying vec3 lightDir; +varying vec3 vLightDir; varying vec4 texCoord; varying vec4 vTexCoord; varying vec3 normal; @@ -18,7 +21,12 @@ varying vec4 color; varying vec4 vColor; void main() { - gl_Position = positionMatrix * vertPos; + //const vec3 lightPos = vec3(0.0, -2.94, 1.0); + const vec3 lightPos = vec3(-10.0, 2.0, 15.0); + + vec4 posEye = mvMatrix * vertPos; // Vertex position in eye space + gl_Position = projMatrix * posEye; // Vertex position in normalized device coordinates + vLightDir = lightDir = lightPos - posEye.xyz / posEye.w; // Light position relative to vertex vTexCoord = texCoord = vertTexCoord; vNormal = normal = normalize(normalMatrix * vertNormal); vColor = color = vertColor; diff --git a/data/shaders/dancenote.vert b/data/shaders/dancenote.vert index c9b9c92..837101a 100644 --- a/data/shaders/dancenote.vert +++ b/data/shaders/dancenote.vert @@ -1,6 +1,7 @@ #version 120 -uniform mat4 positionMatrix; +uniform mat4 projMatrix; +uniform mat4 mvMatrix; uniform mat3 normalMatrix; uniform int noteType; uniform float hitAnim; @@ -75,6 +76,6 @@ void main() { ); } - gl_Position = positionMatrix * (vec4(position, 0, 0) + trans * vertPos); + gl_Position = projMatrix * mvMatrix * (vec4(position, 0, 0) + trans * vertPos); } diff --git a/data/shaders/stereo3d.geom b/data/shaders/stereo3d.geom index c94adb1..66d1d0e 100644 --- a/data/shaders/stereo3d.geom +++ b/data/shaders/stereo3d.geom @@ -7,11 +7,13 @@ uniform float z0; layout(triangles) in; layout(triangle_strip, max_vertices = 6) out; +in vec3 vLightDir[]; in vec4 vTexCoord[]; in vec3 vNormal[]; in vec4 vColor[]; out float bogus; // Workaround for http://www.nvnews.net/vbulletin/showthread.php?p=2401097 +out vec3 lightDir; out vec4 texCoord; out vec3 normal; out vec4 color; @@ -20,6 +22,7 @@ int i; void passthru() { gl_Position = gl_in[i].gl_Position; + lightDir = vLightDir[i]; texCoord = vTexCoord[i]; normal = vNormal[i]; color = vColor[i]; diff --git a/game/guitargraph.cc b/game/guitargraph.cc index f3519e9..aeb9d30 100644 --- a/game/guitargraph.cc +++ b/game/guitargraph.cc @@ -890,7 +890,8 @@ void GuitarGraph::drawNeckStuff(double time) { if (jumpanim == 1.0) m_drumJump.setTarget(0.0); if (jumpanim > 0) m = translate(vec3(0.0f, -m_drumJump.get() * 0.01, 0.0f)) * m; } - Transform trans(m); + //Transform trans(m); + ViewTrans trans(m); // Draw the neck { diff --git a/game/video_driver.cc b/game/video_driver.cc index e173d22..568e219 100644 --- a/game/video_driver.cc +++ b/game/video_driver.cc @@ -44,7 +44,7 @@ namespace { glmath::mat4 g_color = glmath::mat4::identity(); glmath::mat4 g_projection = glmath::mat4::identity(); - glmath::mat4 g_modelview = glmath::translate(glmath::vec3(0.0, 0.0, -z0)); + glmath::mat4 g_modelview = glmath::mat4::identity(); } @@ -155,12 +155,12 @@ void Window::updateColor() { void Window::updateTransforms() { using namespace glmath; - mat4 position = g_projection * g_modelview; mat3 normal(g_modelview); for (ShaderMap::iterator it = m_shaders.begin(); it != m_shaders.end(); ++it) { Shader& sh = *it->second; sh.bind(); - sh["positionMatrix"].setMat4(position); + sh["projMatrix"].setMat4(g_projection); + sh["mvMatrix"].setMat4(g_modelview); try { sh["normalMatrix"].setMat3(normal); } catch(...) {} // Not fatal if normalMatrix is missing (only 3d objects use it) @@ -315,6 +315,22 @@ void Window::screenshot() { std::clog << "video/info: Screenshot taken: " << filename << " (" << img.w << "x" << img.h << ")" << std::endl; } +ColorTrans::ColorTrans(Color const& c): m_old(g_color) { + using namespace glmath; + g_color = g_color * mat4::diagonal(vec4(c.r, c.g, c.b, c.a)); + ScreenManager::getSingletonPtr()->window().updateColor(); +} + +ColorTrans::ColorTrans(glmath::mat4 const& mat): m_old(g_color) { + g_color = g_color * mat; + ScreenManager::getSingletonPtr()->window().updateColor(); +} + +ColorTrans::~ColorTrans() { + g_color = m_old; + ScreenManager::getSingletonPtr()->window().updateColor(); +} + ViewTrans::ViewTrans(double offsetX, double offsetY, double frac): m_old(g_projection) { // Setup the projection matrix for 2D translates using namespace glmath; @@ -329,24 +345,13 @@ ViewTrans::ViewTrans(double offsetX, double offsetY, double frac): m_old(g_proje y1 -= persY; y2 -= persY; // Perspective projection + the rest of the offset in eye (world) space g_projection = frustum(f * x1, f * x2, f * y1, f * y2, near_, far_) - * translate(vec3(offsetX - persX, offsetY - persY, 0.0)); + * translate(vec3(offsetX - persX, offsetY - persY, -z0)); ScreenManager::getSingletonPtr()->window().updateTransforms(); } -ColorTrans::ColorTrans(Color const& c): m_old(g_color) { - using namespace glmath; - g_color = g_color * mat4::diagonal(vec4(c.r, c.g, c.b, c.a)); - ScreenManager::getSingletonPtr()->window().updateColor(); -} - -ColorTrans::ColorTrans(glmath::mat4 const& mat): m_old(g_color) { - g_color = g_color * mat; - ScreenManager::getSingletonPtr()->window().updateColor(); -} - -ColorTrans::~ColorTrans() { - g_color = m_old; - ScreenManager::getSingletonPtr()->window().updateColor(); +ViewTrans::ViewTrans(glmath::mat4 const& m): m_old(g_projection) { + g_projection = g_projection * m; + ScreenManager::getSingletonPtr()->window().updateTransforms(); } ViewTrans::~ViewTrans() { @@ -354,7 +359,6 @@ ViewTrans::~ViewTrans() { ScreenManager::getSingletonPtr()->window().updateTransforms(); } - Transform::Transform(glmath::mat4 const& m): m_old(g_modelview) { g_modelview = g_modelview * m; ScreenManager::getSingletonPtr()->window().updateTransforms(); diff --git a/game/video_driver.hh b/game/video_driver.hh index 54b1d50..3d38e1b 100644 --- a/game/video_driver.hh +++ b/game/video_driver.hh @@ -20,9 +20,11 @@ private: glmath::mat4 m_old; }; -/// Apply a subviewport with different perspective projection class ViewTrans { public: + /// Apply a translation on top of current viewport translation + ViewTrans(glmath::mat4 const& m); + /// Apply a subviewport with different perspective projection ViewTrans(double offsetX = 0.0, double offsetY = 0.0, double frac = 1.0); ~ViewTrans(); private: |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:39
|
Author: Lasse Karkkainen <tro...@tr...> Date: Fri Jul 1 00:27:28 2011 +0300 Merge branch 'opengl2' into dance3d Conflicts: game/ffmpeg.hh --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:30
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jun 28 00:27:17 2011 +0300
Someone used 1-based array indices but in C they begin at zero. Needs
testing.
---
tools/pak.cpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/pak.cpp b/tools/pak.cpp
index 6d1c79b..198577c 100644
--- a/tools/pak.cpp
+++ b/tools/pak.cpp
@@ -64,8 +64,8 @@ Pak::Pak(std::string const& filename) {
name += std::string(tmp, string_length - 1);
unsigned ext_idx = readLE<1>(f);
char toto[2];
- toto[1] = '0' + ext.size();
- toto[2] = '\0';
+ toto[0] = '0' + ext.size();
+ toto[1] = '\0';
if (ext_idx) name += std::string(".") + (ext_idx <= ext.size() ? ext[ext_idx-1] : std::string(toto));
std::replace(name.begin(), name.end(), '\\', '/');
m_files.insert(std::make_pair(name, file));
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:24
|
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Jun 28 00:26:31 2011 +0300
Shader fixes for Radeon on Windows (Performous wouldn't start).
---
data/shaders/stereo3d.geom | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/data/shaders/stereo3d.geom b/data/shaders/stereo3d.geom
index 0c316cb..c94adb1 100644
--- a/data/shaders/stereo3d.geom
+++ b/data/shaders/stereo3d.geom
@@ -26,12 +26,12 @@ 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 < 3); EndPrimitive();
void main() {
bogus = 0.0;
if (sepFactor == 0.0) {
- gl_ViewportIndex = 0; PROCESS(); // No stereo
+ gl_ViewportIndex = 0; PROCESS(;); // No stereo
} else {
gl_ViewportIndex = 1; PROCESS(gl_Position.x -= sepFactor * (gl_Position.z - z0)); // Left eye
gl_ViewportIndex = 2; PROCESS(gl_Position.x += sepFactor * (gl_Position.z - z0)); // Right eye
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:16
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Wed Jun 22 01:39:54 2011 +0200
Fixed compile failure on newest ffmpeg version (once again)
---
game/ffmpeg.cc | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/game/ffmpeg.cc b/game/ffmpeg.cc
index e565a04..61138cf 100644
--- a/game/ffmpeg.cc
+++ b/game/ffmpeg.cc
@@ -47,6 +47,12 @@ double FFmpeg::duration() const {
return d >= 0.0 ? d : getInf();
}
+// FFMPEG has fluctuating API
+#if LIBAVCODEC_VERSION_INT < ((52<<16)+(64<<8)+0)
+#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO
+#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO
+#endif
+
void FFmpeg::open() {
boost::mutex::scoped_lock l(s_avcodec_mutex);
av_register_all();
@@ -60,8 +66,8 @@ void FFmpeg::open() {
for (unsigned int i=0; i<pFormatCtx->nb_streams; i++) {
AVCodecContext* cc = pFormatCtx->streams[i]->codec;
cc->workaround_bugs = FF_BUG_AUTODETECT;
- if (videoStream == -1 && cc->codec_type==CODEC_TYPE_VIDEO) videoStream = i;
- if (audioStream == -1 && cc->codec_type==CODEC_TYPE_AUDIO) audioStream = i;
+ if (videoStream == -1 && cc->codec_type==AVMEDIA_TYPE_VIDEO) videoStream = i;
+ if (audioStream == -1 && cc->codec_type==AVMEDIA_TYPE_AUDIO) audioStream = i;
}
if (videoStream == -1 && decodeVideo) throw std::runtime_error("No video stream found");
if (audioStream == -1 && decodeAudio) throw std::runtime_error("No audio stream found");
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:08
|
Author: Tapio Vierros <tap...@gm...> Date: Mon Apr 11 18:58:40 2011 +0300 Added a PO template for tinkering with Launchpad translations. --- lang/performous.pot | 553 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 553 insertions(+), 0 deletions(-) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:37:02
|
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: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:36:54
|
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: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:36:47
|
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-07-06 23:36:40
|
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: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:36:33
|
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-07-06 23:36:25
|
Author: Vincent Le Ligeour <yo...@us...>
Date: Tue Jun 7 18:04:40 2011 +0200
Fixed theme not being set before loading singer layout
---
game/screen_sing.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index a64505e..92b460c 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -54,6 +54,7 @@ void ScreenSing::enter() {
m_video.reset(new Video(m_song->path + m_song->video, m_song->videoGap));
}
boost::ptr_vector<Analyzer>& analyzers = m_audio.analyzers();
+ reloadGL();
m_layout_singer.reset(new LayoutSinger(m_song->getVocalTrack(m_selectedTrack), m_database, theme));
// Load instrument and dance tracks
sm->loading(_("Loading instruments..."), 0.8);
@@ -110,7 +111,6 @@ void ScreenSing::enter() {
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);
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:36:18
|
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-07-06 23:36:13
|
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-07-06 23:36:02
|
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: Lasse Kärkkäi. <tr...@us...> - 2011-07-06 23:35:54
|
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-07-06 23:35:47
|
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-07-06 23:35:40
|
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
|