You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 17:12:07
|
Module: performous
Branch: opengl2
Commit: 64aa74f044e6ef3a5f0107dd3728cad6affd27fc
Author: Tapio Vierros <tap...@gm...>
Date: Sun Oct 31 17:48:35 2010 +0200
Make Windows installer songdir shortcut work.
---
win32/cross-from-debian/makepackage.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/win32/cross-from-debian/makepackage.py b/win32/cross-from-debian/makepackage.py
index ead4213..2277820 100755
--- a/win32/cross-from-debian/makepackage.py
+++ b/win32/cross-from-debian/makepackage.py
@@ -85,12 +85,12 @@ for root, dirs, files in os.walk('.'):
makensis.stdin.write(r''' WriteRegStr HKLM "Software\Performous" "" "$INSTDIR"
WriteUninstaller "$INSTDIR\uninst.exe"
- CreateDirectory "$APPDATA\performous\songs"
SetShellVarContext all
+ CreateDirectory "$INSTDIR\songs"
CreateDirectory "$SMPROGRAMS\Performous"
CreateShortcut "$SMPROGRAMS\Performous\Performous.lnk" "$INSTDIR\bin\performous.exe"
CreateShortCut "$SMPROGRAMS\Performous\ConfigureSongDirectory.lnk" "$INSTDIR\bin\ConfigureSongDirectory.bat"
- CreateShortCut "$SMPROGRAMS\Performous\Songs.lnk" "$APPDATA\performous\songs"
+ CreateShortCut "$SMPROGRAMS\Performous\Songs.lnk" "$INSTDIR\songs"
CreateShortcut "$SMPROGRAMS\Performous\Uninstall.lnk" "$INSTDIR\uninst.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "DisplayName" "Performous"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Performous" "UninstallString" "$\"$INSTDIR\uninst.exe$\""
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 17:12:02
|
Module: performous Branch: opengl2 Commit: 3be1edfb5ba87a355f33319bcd91837da6362e26 Author: Vincent Le Ligeour <yo...@us...> Date: Fri Oct 29 11:12:02 2010 +0200 Removed unneeded include --- game/instrumentgraph.cc | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc index c657636..d8a5580 100644 --- a/game/instrumentgraph.cc +++ b/game/instrumentgraph.cc @@ -1,6 +1,5 @@ #include "instrumentgraph.hh" #include "i18n.hh" -#include "screen.hh" #include "glutil.hh" //const unsigned InstrumentGraph::max_panels = 10; // Maximum number of arrow lines / guitar frets |
|
From: Peque <ms...@us...> - 2010-11-03 16:16:02
|
Module: performous
Branch: master
Commit: 8b9ce92bc02d82ed78e72d8815f15edb2c24892a
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Wed Nov 3 17:13:41 2010 +0100
Fedora 14 is now 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 5d5f8dc..da39d4e 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 "Fedora14")
+ set(CPACK_RPM_PACKAGE_REQUIRES "gettext, gtk2, cairo, librsvg2, libsigc++20, glibmm24, libxml++, ImageMagick-c++, boost, SDL, glew, ffmpeg, pulseaudio-libs, portaudio, opencv")
+ endif("${LSB_DISTRIB}" MATCHES "Fedora14")
if("${LSB_DISTRIB}" MATCHES "Fedora13")
set(CPACK_RPM_PACKAGE_REQUIRES "gettext, gtk2, cairo, librsvg2, libsigc++20, glibmm24, libxml++, ImageMagick-c++, boost, SDL, glew, ffmpeg, pulseaudio-libs, portaudio, opencv")
endif("${LSB_DISTRIB}" MATCHES "Fedora13")
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 00:01:41
|
Module: performous
Branch: opengl2
Commit: a4f05eab73af8b65ec0d5f23691fac8106016551
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 02:00:21 2010 +0200
No place for DisplayList anymore.
---
game/glutil.hh | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/game/glutil.hh b/game/glutil.hh
index b8185d7..c8e3a06 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -10,6 +10,7 @@
#include "glshader.hh"
namespace glutil {
+
struct Point {
float vx;
float vy;
@@ -39,13 +40,6 @@ namespace glutil {
};
/// wrapper struct for RAII
- struct DisplayList {
- /// call glNewList with given list id and mode
- DisplayList(GLuint id, GLenum mode) { glNewList(id, mode); }
- ~DisplayList() { glEndList(); }
- };
-
- /// wrapper struct for RAII
struct UseDepthTest {
/// enable depth test (for 3d objects)
UseDepthTest() {
@@ -57,6 +51,7 @@ namespace glutil {
}
};
+ /// wrapper struct for RAII
struct Color {
float r, ///< red component
g, ///< green
@@ -207,5 +202,6 @@ namespace glutil {
}
static void reset() { glGetError(); }
};
+
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 00:01:38
|
Module: performous
Branch: opengl2
Commit: fce1dabed4b256d9ded74665dc0678879e63905a
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 01:57:49 2010 +0200
Switch shader in Object3d::draw to avoid having to deal with tail lighting.
---
game/3dobject.hh | 1 +
game/guitargraph.cc | 9 ++++-----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 29f6d66..6a32cb7 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -70,6 +70,7 @@ class Object3d: boost::noncopyable {
glutil::PushMatrix pm;
glTranslatef(x, y, z); // Move to position
if (s != 1.0) glScalef(s,s,s); // Scale if needed
+ UseShader objectShader(*shader); // Switch shader
if (m_texture) {
UseTexture tex(*m_texture, *shader);
drawVBO();
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5420862..ad04389 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -778,8 +778,8 @@ namespace {
color.a = y2a(y);
{
glutil::Color c(color);
- va.Color(c).Normal(0.0f, 1.0f, 0.0f).TexCoord(0.0f, ty).Vertex(x - fretW, y);
- va.Color(c).Normal(0.0f, 1.0f, 0.0f).TexCoord(1.0f, ty).Vertex(x + fretW, y);
+ va.Color(c).TexCoord(0.0f, ty).Vertex(x - fretW, y);
+ va.Color(c).TexCoord(1.0f, ty).Vertex(x + fretW, y);
}
}
}
@@ -855,8 +855,7 @@ void GuitarGraph::draw(double time) {
}
// Draw the notes
- { UseShader objectShader(*Object3d::shader);
- glutil::UseDepthTest depthtest;
+ { glutil::UseDepthTest depthtest;
// Draw drum fills / Big Rock Endings
bool drumfill = m_dfIt != m_drumfills.end() && m_dfIt->begin - time <= future;
if (drumfill) {
@@ -922,7 +921,7 @@ void GuitarGraph::draw(double time) {
}
glutil::GLErrorChecker::reset(); // FIXME: There are errors here.
//glutil::GLErrorChecker glerror("GuitarGraph::draw - objects");
- } //< restore core shader and disable depth test
+ } //< disable depth test
// Draw flames
for (int fret = 0; fret < m_pads; ++fret) { // Loop through the frets
if (m_drums && fret == 0) { // Skip bass drum
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 00:01:35
|
Module: performous
Branch: opengl2
Commit: 72038dadd389cdeab206476e2c39ea1bc5e39470
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 01:53:27 2010 +0200
UseShader now figures the old program by itself.
---
game/glshader.hh | 7 ++++---
game/guitargraph.cc | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/game/glshader.hh b/game/glshader.hh
index d834936..4705117 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -26,12 +26,13 @@ struct Shader: public boost::noncopyable {
/** Temporarily switch shader in a RAII manner. */
struct UseShader {
- UseShader(Shader& new_shader, Shader& old_shader): m_old(old_shader) {
+ UseShader(Shader& new_shader) {
+ glGetIntegerv(GL_CURRENT_PROGRAM, &m_old);
new_shader.bind();
}
- ~UseShader() { m_old.bind(); }
+ ~UseShader() { glUseProgram(m_old); }
private:
- Shader& m_old;
+ GLint m_old;
};
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 099c8e3..5420862 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -855,7 +855,7 @@ void GuitarGraph::draw(double time) {
}
// Draw the notes
- { UseShader objectShader(*Object3d::shader, *Window::shader);
+ { UseShader objectShader(*Object3d::shader);
glutil::UseDepthTest depthtest;
// Draw drum fills / Big Rock Endings
bool drumfill = m_dfIt != m_drumfills.end() && m_dfIt->begin - time <= future;
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 22:55:18
|
Module: performous
Branch: opengl2
Commit: 9922131f5ad16cdbdad233e6a22deeffb959ba02
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 00:54:35 2010 +0200
Small fragment shader clean-ups.
---
themes/default/shaders/3dobject.frag | 2 +-
themes/default/shaders/core.frag | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
index cce3a8b..67c317e 100644
--- a/themes/default/shaders/3dobject.frag
+++ b/themes/default/shaders/3dobject.frag
@@ -17,7 +17,7 @@ void main()
} else if (texMode == 0) {
texel = vec4(1.0, 1.0, 1.0, 1.0);
} else {
- texel = vec4(1.0, 0.0, 0.0, 1.0);
+ texel = vec4(1.0, 0.0, 1.0, 1.0); // Magenta to highlight
}
float NdotL = max(dot(normalize(normal), lightDir), 0.0);
diff --git a/themes/default/shaders/core.frag b/themes/default/shaders/core.frag
index 3d9b59b..fcf50ce 100644
--- a/themes/default/shaders/core.frag
+++ b/themes/default/shaders/core.frag
@@ -5,15 +5,16 @@ uniform sampler2DRect texRect;
void main()
{
vec4 texel;
- vec4 color;
+
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
texel = texture2DRect(texRect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
- texel = gl_Color;
+ texel = vec4(1.0, 1.0, 1.0, 1.0);
} else {
- texel = vec4(1.0,0.0,0.0,1.0);
+ texel = vec4(1.0, 0.0, 1.0, 1.0); // Magenta to highlight
}
- gl_FragColor = vec4(texel.rgb*gl_Color.rgb, texel.a*gl_Color.a);
+
+ gl_FragColor = texel * gl_Color;
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 22:41:12
|
Module: performous
Branch: opengl2
Commit: c90d21c4dc060eb9b839549b17378361d48a1e90
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 00:38:03 2010 +0200
Refactor UseLighting into UseDepthTest.
* Because lighting is done entirely with shaders.
* Improves 3d object drawing and lighting.
* Still not good lighting.
---
game/glutil.hh | 25 ++++++-------------------
game/guitargraph.cc | 4 ++--
2 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/game/glutil.hh b/game/glutil.hh
index 9af0f77..b8185d7 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -46,26 +46,13 @@ namespace glutil {
};
/// wrapper struct for RAII
- struct UseLighting {
- /// enable lighting and depth test for 3d objects
- UseLighting(bool doit = true) {
- if (doit) {
- glClear(GL_DEPTH_BUFFER_BIT);
- glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
-
- GLfloat light_position[] = { -50.0, 15.0, -5.0, 1.0 };
- glLightfv(GL_LIGHT0, GL_POSITION, light_position);
-
- glEnable(GL_DEPTH_TEST);
- glEnable(GL_LIGHTING);
- glEnable(GL_COLOR_MATERIAL);
- glEnable(GL_LIGHT0);
- }
+ struct UseDepthTest {
+ /// enable depth test (for 3d objects)
+ UseDepthTest() {
+ glClear(GL_DEPTH_BUFFER_BIT);
+ glEnable(GL_DEPTH_TEST);
}
- ~UseLighting() {
- glDisable(GL_LIGHT0);
- glDisable(GL_COLOR_MATERIAL);
- glDisable(GL_LIGHTING);
+ ~UseDepthTest() {
glDisable(GL_DEPTH_TEST);
}
};
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 1516dc0..099c8e3 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -856,7 +856,7 @@ void GuitarGraph::draw(double time) {
// Draw the notes
{ UseShader objectShader(*Object3d::shader, *Window::shader);
- //glutil::UseLighting lighting(m_use3d);
+ glutil::UseDepthTest depthtest;
// Draw drum fills / Big Rock Endings
bool drumfill = m_dfIt != m_drumfills.end() && m_dfIt->begin - time <= future;
if (drumfill) {
@@ -922,7 +922,7 @@ void GuitarGraph::draw(double time) {
}
glutil::GLErrorChecker::reset(); // FIXME: There are errors here.
//glutil::GLErrorChecker glerror("GuitarGraph::draw - objects");
- } //< restore core shader
+ } //< restore core shader and disable depth test
// Draw flames
for (int fret = 0; fret < m_pads; ++fret) { // Loop through the frets
if (m_drums && fret == 0) { // Skip bass drum
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 22:41:10
|
Module: performous
Branch: opengl2
Commit: f2b6871da0c0f1e3d0526f852e5ae49246a80bbe
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 00:32:36 2010 +0200
Enabling/disabling texturing is useless with shaders.
---
game/surface.hh | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/game/surface.hh b/game/surface.hh
index 059e029..574a6ae 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -121,8 +121,7 @@ class UseTexture: boost::noncopyable {
public:
/// constructor
template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s, Shader& shdr = *Window::shader):
- m_type(s.type()), m_shader(shdr) {
- glEnable(m_type);
+ m_shader(shdr) {
glUniform1i(m_shader.tex, 0);
glUniform1i(m_shader.texRect, 1);
@@ -132,15 +131,13 @@ class UseTexture: boost::noncopyable {
default: glUniform1i(m_shader.texMode, 3); break;
}
- glBindTexture(m_type, s.id());
+ glBindTexture(Type, s.id());
}
~UseTexture() {
- glDisable(m_type);
glUniform1i(m_shader.texMode, 0);
}
private:
- GLenum m_type;
Shader& m_shader;
};
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 22:41:08
|
Module: performous
Branch: opengl2
Commit: 57e7dc077436ba191def63ce05b7f28c5e1899cc
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 00:15:16 2010 +0200
Attempt to do simple per-pixel directional lighting, but something is broken.
---
themes/default/shaders/3dobject.frag | 16 ++++++++++++----
themes/default/shaders/3dobject.vert | 7 ++++++-
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
index 3d9b59b..cce3a8b 100644
--- a/themes/default/shaders/3dobject.frag
+++ b/themes/default/shaders/3dobject.frag
@@ -2,18 +2,26 @@ uniform int texMode;
uniform sampler2D tex;
uniform sampler2DRect texRect;
+varying vec3 normal;
+
void main()
{
+ const vec3 lightDir = normalize(vec3(-50.0, 5.0, -15.0));
+ const vec3 ambient = vec3(0.1, 0.1, 0.1);
vec4 texel;
- vec4 color;
+
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
texel = texture2DRect(texRect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
- texel = gl_Color;
+ texel = vec4(1.0, 1.0, 1.0, 1.0);
} else {
- texel = vec4(1.0,0.0,0.0,1.0);
+ texel = vec4(1.0, 0.0, 0.0, 1.0);
}
- gl_FragColor = vec4(texel.rgb*gl_Color.rgb, texel.a*gl_Color.a);
+
+ float NdotL = max(dot(normalize(normal), lightDir), 0.0);
+ vec3 color = ambient + texel.rgb * gl_Color.rgb * NdotL;
+
+ gl_FragColor = vec4(color, texel.a * gl_Color.a);
}
diff --git a/themes/default/shaders/3dobject.vert b/themes/default/shaders/3dobject.vert
index 570a61a..2c3013a 100644
--- a/themes/default/shaders/3dobject.vert
+++ b/themes/default/shaders/3dobject.vert
@@ -1,7 +1,12 @@
+varying vec3 normal;
+
void main()
{
+ normal = normalize(gl_NormalMatrix * gl_Normal);
+
gl_FrontColor = gl_Color;
gl_BackColor = gl_Color;
gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_Position = ftransform();
+
+ gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 20:50:51
|
Module: performous
Branch: opengl2
Commit: 87c393509f9b6ad08722c9b88f2e9b643549716a
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 22:49:27 2010 +0200
Get rid of #defines in 3dobject.
---
game/3dobject.cc | 19 +++++++++++--------
game/3dobject.hh | 3 ---
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index 7602460..8323db1 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -11,6 +11,9 @@
namespace {
+ static const int HAS_TEXCOORDS = 1;
+ static const int HAS_NORMALS = 2;
+
/// Returns a word (delimited by delim) in a string st at position pos (1-based)
std::string getWord(std::string& st, size_t pos, char delim) {
std::istringstream iss(st);
@@ -85,8 +88,8 @@ void Object3d::loadWavefrontObj(std::string filepath, float scale) {
void Object3d::drawVBO() {
int stride = 3*sizeof(GLfloat);
int offset = 0;
- if (m_vboStructure & _3DOBJECT_TEXCOORDS) stride += 2*sizeof(GLfloat);
- if (m_vboStructure & _3DOBJECT_NORMALS) stride += 3*sizeof(GLfloat);
+ if (m_vboStructure & HAS_TEXCOORDS) stride += 2*sizeof(GLfloat);
+ if (m_vboStructure & HAS_NORMALS) stride += 3*sizeof(GLfloat);
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
@@ -94,12 +97,12 @@ void Object3d::drawVBO() {
glVertexPointer(3, GL_FLOAT, stride, (const GLvoid *)offset);
offset += 3*sizeof(GLfloat);
- if (m_vboStructure & _3DOBJECT_TEXCOORDS) {
+ if (m_vboStructure & HAS_TEXCOORDS) {
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, stride, (const GLvoid *)offset);
offset += 2*sizeof(GLfloat);
}
- if (m_vboStructure & _3DOBJECT_NORMALS) {
+ if (m_vboStructure & HAS_NORMALS) {
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, stride, (const GLvoid *)offset);
}
@@ -129,8 +132,8 @@ void Object3d::generateVBO() {
}
m_vboStructure = 0;
- if (!m_texcoords.empty()) m_vboStructure |= _3DOBJECT_TEXCOORDS;
- if (!m_normals.empty()) m_vboStructure |= _3DOBJECT_NORMALS;
+ if (!m_texcoords.empty()) m_vboStructure |= HAS_TEXCOORDS;
+ if (!m_normals.empty()) m_vboStructure |= HAS_NORMALS;
std::vector<Face>::const_iterator i;
for (i = m_faces.begin(); i != m_faces.end(); ++i) {
@@ -139,12 +142,12 @@ void Object3d::generateVBO() {
data.push_back(m_vertices[i->vertices[j]].y);
data.push_back(m_vertices[i->vertices[j]].z);
- if (m_vboStructure & _3DOBJECT_TEXCOORDS) {
+ if (m_vboStructure & HAS_TEXCOORDS) {
data.push_back(m_texcoords[i->texcoords[j]].s);
data.push_back(m_texcoords[i->texcoords[j]].t);
}
- if (m_vboStructure & _3DOBJECT_NORMALS) {
+ if (m_vboStructure & HAS_NORMALS) {
data.push_back(m_normals[i->normals[j]].x);
data.push_back(m_normals[i->normals[j]].y);
data.push_back(m_normals[i->normals[j]].z);
diff --git a/game/3dobject.hh b/game/3dobject.hh
index b650738..29f6d66 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -7,9 +7,6 @@
#include "surface.hh"
#include "glutil.hh"
-#define _3DOBJECT_TEXCOORDS 1
-#define _3DOBJECT_NORMALS 2
-
// TODO: Exception handling
// TODO: Texture loading
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 20:50:47
|
Module: performous
Branch: opengl2
Commit: 0d381e018623546f8a909f49bceeeb7f95642573
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 22:44:28 2010 +0200
Cache shader uniform locations.
---
game/3dobject.cc | 2 --
game/3dobject.hh | 2 +-
game/glshader.cc | 6 ++++++
game/glshader.hh | 4 +++-
game/surface.hh | 26 +++++++++-----------------
themes/default/shaders/3dobject.frag | 4 ++--
themes/default/shaders/core.frag | 4 ++--
7 files changed, 23 insertions(+), 25 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index bde08e3..7602460 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -95,8 +95,6 @@ void Object3d::drawVBO() {
offset += 3*sizeof(GLfloat);
if (m_vboStructure & _3DOBJECT_TEXCOORDS) {
- if (m_texture) UseTexture tex(*m_texture);
-
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(2, GL_FLOAT, stride, (const GLvoid *)offset);
offset += 2*sizeof(GLfloat);
diff --git a/game/3dobject.hh b/game/3dobject.hh
index cef6e40..b650738 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -74,7 +74,7 @@ class Object3d: boost::noncopyable {
glTranslatef(x, y, z); // Move to position
if (s != 1.0) glScalef(s,s,s); // Scale if needed
if (m_texture) {
- UseTexture tex(*m_texture, shader->program);
+ UseTexture tex(*m_texture, *shader);
drawVBO();
} else {
drawVBO();
diff --git a/game/glshader.cc b/game/glshader.cc
index bb0f967..b2c6044 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -107,6 +107,12 @@ void Shader::loadFromMemory(const char* vert_source, const char* frag_source, bo
}
glutil::GLErrorChecker linkerror("Shader::loadFromMemory - glLinkProgram");
+ // Cache uniform locations
+ tex = glGetUniformLocation(program, "tex");
+ texRect = glGetUniformLocation(program, "texRect");
+ texMode = glGetUniformLocation(program, "texMode");
+ glutil::GLErrorChecker uniformerror("Shader::loadFromMemory - glGetUniformLocation");
+
if (use) bind();
}
diff --git a/game/glshader.hh b/game/glshader.hh
index ed394eb..d834936 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -4,6 +4,7 @@
#include <GL/glew.h>
#include <boost/noncopyable.hpp>
+
struct Shader: public boost::noncopyable {
Shader();
Shader(const std::string& vert_path, const std::string& frag_path, bool use = false);
@@ -17,7 +18,8 @@ struct Shader: public boost::noncopyable {
/** Binds the shader into use. */
void bind();
- GLuint program, vert_shader, frag_shader;
+ GLuint program, vert_shader, frag_shader; ///< shader object ids
+ GLint tex, texRect, texMode; ///< uniform locations
int gl_response;
};
diff --git a/game/surface.hh b/game/surface.hh
index ee008a1..059e029 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -120,36 +120,28 @@ template <GLenum Type> class OpenGLTexture: boost::noncopyable {
class UseTexture: boost::noncopyable {
public:
/// constructor
- template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s, GLuint prog = 0):
- m_type(s.type()), m_program(prog) {
- if (m_program == 0) m_program = Window::shader->program; // Default shader
-
- GLint texmodeloc = glGetUniformLocation(m_program, "texMode");
- GLint texloc = glGetUniformLocation(m_program, "tex");
- GLint texrectloc = glGetUniformLocation(m_program, "texrect");
-
- glUniform1i(texloc, 0);
- glUniform1i(texrectloc, 1);
-
+ template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s, Shader& shdr = *Window::shader):
+ m_type(s.type()), m_shader(shdr) {
glEnable(m_type);
+ glUniform1i(m_shader.tex, 0);
+ glUniform1i(m_shader.texRect, 1);
switch (Type) {
- case GL_TEXTURE_2D: glActiveTexture(GL_TEXTURE0); glUniform1i(texmodeloc, 1); break;
- case GL_TEXTURE_RECTANGLE_ARB: glActiveTexture(GL_TEXTURE0+1); glUniform1i(texmodeloc, 2); break;
- default: glUniform1i(texmodeloc, 3); break;
+ case GL_TEXTURE_2D: glActiveTexture(GL_TEXTURE0); glUniform1i(m_shader.texMode, 1); break;
+ case GL_TEXTURE_RECTANGLE_ARB: glActiveTexture(GL_TEXTURE0+1); glUniform1i(m_shader.texMode, 2); break;
+ default: glUniform1i(m_shader.texMode, 3); break;
}
glBindTexture(m_type, s.id());
}
~UseTexture() {
- GLint texmodeloc = glGetUniformLocation(m_program, "texMode");
glDisable(m_type);
- glUniform1i(texmodeloc, 0);
+ glUniform1i(m_shader.texMode, 0);
}
private:
GLenum m_type;
- GLuint m_program;
+ Shader& m_shader;
};
template <GLenum Type> void OpenGLTexture<Type>::draw(Dimensions const& dim, TexCoords const& tex) const {
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
index b351e4a..3d9b59b 100644
--- a/themes/default/shaders/3dobject.frag
+++ b/themes/default/shaders/3dobject.frag
@@ -1,6 +1,6 @@
uniform int texMode;
uniform sampler2D tex;
-uniform sampler2DRect texrect;
+uniform sampler2DRect texRect;
void main()
{
@@ -9,7 +9,7 @@ void main()
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
- texel = texture2DRect(texrect, gl_TexCoord[0].st).rgba;
+ texel = texture2DRect(texRect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
texel = gl_Color;
} else {
diff --git a/themes/default/shaders/core.frag b/themes/default/shaders/core.frag
index b351e4a..3d9b59b 100644
--- a/themes/default/shaders/core.frag
+++ b/themes/default/shaders/core.frag
@@ -1,6 +1,6 @@
uniform int texMode;
uniform sampler2D tex;
-uniform sampler2DRect texrect;
+uniform sampler2DRect texRect;
void main()
{
@@ -9,7 +9,7 @@ void main()
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
- texel = texture2DRect(texrect, gl_TexCoord[0].st).rgba;
+ texel = texture2DRect(texRect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
texel = gl_Color;
} else {
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 17:09:34
|
Module: performous
Branch: opengl2
Commit: 8f737ddd9724e375087b669150b7e0c71c6a751b
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 19:08:55 2010 +0200
Shader compatibility fix.
---
themes/default/shaders/3dobject.frag | 2 +-
themes/default/shaders/core.frag | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
index ae5a802..b351e4a 100644
--- a/themes/default/shaders/3dobject.frag
+++ b/themes/default/shaders/3dobject.frag
@@ -9,7 +9,7 @@ void main()
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
- texel = texture(texrect, gl_TexCoord[0].st).rgba;
+ texel = texture2DRect(texrect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
texel = gl_Color;
} else {
diff --git a/themes/default/shaders/core.frag b/themes/default/shaders/core.frag
index ae5a802..b351e4a 100644
--- a/themes/default/shaders/core.frag
+++ b/themes/default/shaders/core.frag
@@ -9,7 +9,7 @@ void main()
if (texMode == 1) {
texel = texture2D(tex, gl_TexCoord[0].st).rgba;
} else if (texMode == 2) {
- texel = texture(texrect, gl_TexCoord[0].st).rgba;
+ texel = texture2DRect(texrect, gl_TexCoord[0].st).rgba;
} else if (texMode == 0) {
texel = gl_Color;
} else {
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 15:46:10
|
Module: performous Branch: opengl2 Commit: dcdda69e012876d634e9fa4ea0debd2fbd086188 Author: Tapio Vierros <tap...@gm...> Date: Tue Nov 2 17:44:53 2010 +0200 VertexArray member calls can now be chained in style of Dimensions. This fancy new notation is also taken into use. --- game/dancegraph.cc | 8 ++++---- game/glutil.hh | 18 ++++++++++++------ game/guitargraph.cc | 40 ++++++++++++++++++++-------------------- game/notegraph.cc | 24 ++++++++++++------------ game/screen_songs.cc | 40 ++++++++++++++++++++-------------------- game/surface.hh | 8 ++++---- 6 files changed, 72 insertions(+), 66 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-11-02 15:24:20
|
Module: performous
Branch: opengl2
Commit: 5b6dc1b3a2b0fdd8f8b915b39fab3662953efaba
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 17:22:50 2010 +0200
Since ~everything is drawed with GL_TRIANGLE_STRIP, make that default for VertexArray::Draw().
---
game/dancegraph.cc | 6 +++---
game/glutil.hh | 8 +-------
game/guitargraph.cc | 14 +++++++-------
game/notegraph.cc | 2 +-
game/screen_sing.cc | 2 +-
game/screen_songs.cc | 10 +++++-----
game/surface.hh | 2 +-
7 files changed, 19 insertions(+), 25 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index cb7a657..ed1bf46 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -403,7 +403,7 @@ void DanceGraph::drawArrow(int arrow_i, Texture& tex, float x, float y, float sc
glutil::VertexArray va;
vertexPair(va, arrow_i, 0.0f, -arrowSize, ty1);
vertexPair(va, arrow_i, 0.0f, arrowSize, ty2);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
@@ -480,7 +480,7 @@ void DanceGraph::drawBeats(double time) {
va.Color(c); va.Normal(0.0f, 1.0f, 0.0f); va.TexCoord(0.0f, texCoord); va.Vertex(-w, time2y(tEnd));
va.Color(c); va.Normal(0.0f, 1.0f, 0.0f); va.TexCoord(1.0f, texCoord); va.Vertex(w, time2y(tEnd));
}
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
/// Draws a single note (or hold)
@@ -519,7 +519,7 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
vertexPair(va, arrow_i, x, yMid, 2.0f/3.0f, s);
// Draw middle
vertexPair(va, arrow_i, x, yBeg + 2*arrowSize, 1.0f/3.0f, s);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
// Draw begin
if (note.isHit && tEnd < 0.1) {
diff --git a/game/glutil.hh b/game/glutil.hh
index 44a2837..74e7d53 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -140,7 +140,7 @@ namespace glutil {
m_colors.push_back(c.a);
}
- void Draw(GLint mode) {
+ void Draw(GLint mode = GL_TRIANGLE_STRIP) {
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(m_dimension, GL_FLOAT, 0, &m_vertices.front());
if (m_texcoords.size()) {
@@ -164,12 +164,6 @@ namespace glutil {
}
VertexArray() {}
- ~VertexArray() {
- m_vertices.clear();
- m_normals.clear();
- m_texcoords.clear();
- m_colors.clear();
- }
};
/// easy line
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index e871412..e6e0cb8 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -826,7 +826,7 @@ void GuitarGraph::draw(double time) {
va.Normal(0.0f, 1.0f, 0.0f); va.Color(c); va.TexCoord(0.0f, texCoord); va.Vertex(-w, time2y(tEnd));
va.Normal(0.0f, 1.0f, 0.0f); va.Color(c); va.TexCoord(1.0f, texCoord); va.Vertex(w, time2y(tEnd));
}
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
// Draw the cursor
@@ -942,7 +942,7 @@ void GuitarGraph::draw(double time) {
va.TexCoord(1.0f, 1.0f); va.Color(c); va.Vertex(x + fretWid, time2y(0.0f), 0.0f);
va.TexCoord(0.0f, 0.0f); va.Color(c); va.Vertex(x - fretWid, time2y(0.0f), h);
va.TexCoord(1.0f, 0.0f); va.Color(c); va.Vertex(x + fretWid, time2y(0.0f), h);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
} else {
it = m_flames[fret].erase(it);
continue;
@@ -964,7 +964,7 @@ void GuitarGraph::draw(double time) {
va.Color(c); va.Vertex(x, y + maxsize);
va.Color(c); va.Vertex(x - thickness, y - maxsize);
va.Color(c); va.Vertex(x, y - maxsize);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
float error = m_errorMeter.get();
if (error != 0) {
@@ -979,7 +979,7 @@ void GuitarGraph::draw(double time) {
va.Color(c); va.Vertex(x, y1 + y);
va.Color(c); va.Vertex(x - thickness, y2 + y);
va.Color(c); va.Vertex(x, y2 + y);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
if (m_errorMeter.get() == m_errorMeter.getTarget())
m_errorMeter.setTarget(0.0);
@@ -1069,7 +1069,7 @@ void GuitarGraph::drawNote(int fret, Color color, float tBeg, float tEnd, float
y = yEnd + fretWid;
vertexPair(va, x, y, color, doanim ? tc(y + t) : 0.20f);
vertexPair(va, x, yEnd, color, doanim ? tc(yEnd + t) : 0.0f);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
} else {
// Too short note: only render the ring
if (m_use3d) { // 3D
@@ -1130,7 +1130,7 @@ void GuitarGraph::drawDrumfill(float tBeg, float tEnd) {
vertexPair(va, x, yEnd + 2.0 * fretWid, c, 0.25f);
}
vertexPair(va, x, yEnd, c, tcEnd); // Last vertex pair
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
@@ -1186,7 +1186,7 @@ void GuitarGraph::drawBar(double time, float h) {
va.Normal(0.0f, 1.0f, 0.0f); va.Vertex(-2.5f, time2y(time - h));
va.Normal(0.0f, 1.0f, 0.0f); va.Vertex(2.5f, time2y(time - h));
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
/// Create the Chord structures for the current track/difficulty level
diff --git a/game/notegraph.cc b/game/notegraph.cc
index d6cf465..d431be0 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -56,7 +56,7 @@ namespace {
va.TexCoord(1.0f, 0.0f); va.Vertex(x + w, yend);
va.TexCoord(1.0f, 1.0f); va.Vertex(x + w, yend + h);
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 0ab1f11..0e70d46 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -396,7 +396,7 @@ namespace {
va.Vertex(dim.x2(), dim.y1());
va.Vertex(dim.x1(), dim.y2());
va.Vertex(dim.x2(), dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index c46624d..9bbbc52 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -320,7 +320,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
x = dim.x1()+xincr*(dim.x2()-dim.x1());
va.Color(c); va.TexCoord(getIconTex(2), 0.0f); va.Vertex(x, dim.y1());
va.Color(c); va.TexCoord(getIconTex(2), 1.0f); va.Vertex(x, dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
{
// guitars
@@ -336,7 +336,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
x = dim.x1()+(2*xincr+i*0.04)*(dim.x2()-dim.x1());
va.Color(c); va.TexCoord(getIconTex(3), 0.0f); va.Vertex(x, dim.y1());
va.Color(c); va.TexCoord(getIconTex(3), 1.0f); va.Vertex(x, dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
{
@@ -351,7 +351,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
x = dim.x1()+3*xincr*(dim.x2()-dim.x1());
va.Color(c); va.TexCoord(getIconTex(4), 0.0f); va.Vertex(x, dim.y1());
va.Color(c); va.TexCoord(getIconTex(4), 1.0f); va.Vertex(x, dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
{
// drums
@@ -365,7 +365,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
x = dim.x1()+4*xincr*(dim.x2()-dim.x1());
va.Color(c); va.TexCoord(getIconTex(5), 0.0f); va.Vertex(x, dim.y1());
va.Color(c); va.TexCoord(getIconTex(5), 1.0f); va.Vertex(x, dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
{
// dancing
@@ -379,7 +379,7 @@ void ScreenSongs::drawInstruments(Dimensions const& dim, float alpha) const {
x = dim.x1()+5*xincr*(dim.x2()-dim.x1());
va.Color(c); va.TexCoord(getIconTex(6), 0.0f); va.Vertex(x, dim.y1());
va.Color(c); va.TexCoord(getIconTex(6), 1.0f); va.Vertex(x, dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
}
diff --git a/game/surface.hh b/game/surface.hh
index dbb8e9b..9882a25 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -162,7 +162,7 @@ template <GLenum Type> void OpenGLTexture<Type>::draw(Dimensions const& dim, Tex
va.TexCoord(tex.x1, tex.y2); va.Vertex(dim.x1(), dim.y2());
va.TexCoord(tex.x2, tex.y2); va.Vertex(dim.x2(), dim.y2());
- va.Draw(GL_TRIANGLE_STRIP);
+ va.Draw();
}
template <GLenum Type> void OpenGLTexture<Type>::drawCropped(Dimensions const& orig, TexCoords const& tex) const {
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 13:24:49
|
Module: performous
Branch: opengl2
Commit: bb751601732b8095703883067b7ddbc7662c7dd5
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 15:21:25 2010 +0200
Separate shaders for 3d objects.
* This is preparation for lighting and other specialized shader uses.
* The actual shaders are the same as core ones for now.
* New UseShader class analogous to UseTexture.
* UseTexture now takes optional shader program argument.
---
game/3dobject.cc | 2 ++
game/3dobject.hh | 5 +++--
game/glshader.cc | 18 +++++++++++++++++-
game/glshader.hh | 25 ++++++++++++++++++++-----
game/guitargraph.cc | 7 +++++--
game/surface.hh | 14 +++++++++-----
game/video_driver.cc | 8 +++-----
game/video_driver.hh | 3 ++-
themes/default/shaders/3dobject.frag | 19 +++++++++++++++++++
themes/default/shaders/3dobject.vert | 7 +++++++
10 files changed, 87 insertions(+), 21 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index 5bf4338..bde08e3 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -21,6 +21,8 @@ namespace {
}
}
+boost::scoped_ptr<Shader> Object3d::shader;
+
/// Load a Wavefront .obj file and possibly scale it also
void Object3d::loadWavefrontObj(std::string filepath, float scale) {
std::string row;
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 144f9db..cef6e40 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -12,7 +12,6 @@
// TODO: Exception handling
// TODO: Texture loading
-// TODO: Switch to vertex arrays
/// Point in 3d space
struct Vertex {
@@ -75,10 +74,12 @@ class Object3d: boost::noncopyable {
glTranslatef(x, y, z); // Move to position
if (s != 1.0) glScalef(s,s,s); // Scale if needed
if (m_texture) {
- UseTexture tex(*m_texture);
+ UseTexture tex(*m_texture, shader->program);
drawVBO();
} else {
drawVBO();
}
}
+
+ static boost::scoped_ptr<Shader> shader; ///< shader used for 3d objects
};
diff --git a/game/glshader.cc b/game/glshader.cc
index 693e253..bb0f967 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -1,5 +1,8 @@
#include "glshader.hh"
#include "glutil.hh"
+#include "video_driver.hh"
+#include "3dobject.hh"
+#include "fs.hh"
#include <fstream>
#include <stdexcept>
@@ -51,6 +54,7 @@ Shader::~Shader() {
glDeleteProgram(program);
glDeleteShader(vert_shader);
glDeleteShader(frag_shader);
+ //std::clog << "shader/info: Shader program " << (unsigned)program << " deleted." << std::endl;
}
@@ -104,5 +108,17 @@ void Shader::loadFromMemory(const char* vert_source, const char* frag_source, bo
glutil::GLErrorChecker linkerror("Shader::loadFromMemory - glLinkProgram");
if (use) bind();
- glutil::GLErrorChecker glerror("Shader::loadFromMemory - bind");
+}
+
+
+void Shader::bind() {
+ glUseProgram(program);
+ glutil::GLErrorChecker glerror("Shader::bind");
+}
+
+
+
+void loadShaders() {
+ Window::shader.reset(new Shader(getThemePath("shaders/core.vert"), getThemePath("shaders/core.frag"), true));
+ Object3d::shader.reset(new Shader(getThemePath("shaders/3dobject.vert"), getThemePath("shaders/3dobject.frag")));
}
diff --git a/game/glshader.hh b/game/glshader.hh
index 016c601..ed394eb 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -2,21 +2,36 @@
#include <string>
#include <GL/glew.h>
+#include <boost/noncopyable.hpp>
-struct Shader {
+struct Shader: public boost::noncopyable {
Shader();
- Shader(const std::string& vert_path, const std::string& frag_path, bool use = true);
+ Shader(const std::string& vert_path, const std::string& frag_path, bool use = false);
~Shader();
/** Loads the shader from files. */
- void loadFromFile(const std::string& vert_path, const std::string& frag_path, bool use = true);
+ void loadFromFile(const std::string& vert_path, const std::string& frag_path, bool use = false);
/** Loads the shader from memory. */
- void loadFromMemory(const char* vert_source, const char* frag_source, bool use = true);
+ void loadFromMemory(const char* vert_source, const char* frag_source, bool use = false);
/** Binds the shader into use. */
- void bind() { glUseProgram(program); }
+ void bind();
GLuint program, vert_shader, frag_shader;
int gl_response;
};
+
+/** Temporarily switch shader in a RAII manner. */
+struct UseShader {
+ UseShader(Shader& new_shader, Shader& old_shader): m_old(old_shader) {
+ new_shader.bind();
+ }
+ ~UseShader() { m_old.bind(); }
+ private:
+ Shader& m_old;
+};
+
+
+/** Load shaders. */
+void loadShaders();
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 7587dcf..e871412 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -855,7 +855,8 @@ void GuitarGraph::draw(double time) {
}
// Draw the notes
- { glutil::UseLighting lighting(m_use3d);
+ { UseShader objectShader(*Object3d::shader, *Window::shader);
+ //glutil::UseLighting lighting(m_use3d);
// Draw drum fills / Big Rock Endings
bool drumfill = m_dfIt != m_drumfills.end() && m_dfIt->begin - time <= future;
if (drumfill) {
@@ -919,7 +920,9 @@ void GuitarGraph::draw(double time) {
}
}
}
- } //< disable lighting
+ glutil::GLErrorChecker::reset(); // FIXME: There are errors here.
+ //glutil::GLErrorChecker glerror("GuitarGraph::draw - objects");
+ } //< restore core shader
// Draw flames
for (int fret = 0; fret < m_pads; ++fret) { // Loop through the frets
if (m_drums && fret == 0) { // Skip bass drum
diff --git a/game/surface.hh b/game/surface.hh
index 44f187c..dbb8e9b 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -120,10 +120,13 @@ template <GLenum Type> class OpenGLTexture: boost::noncopyable {
class UseTexture: boost::noncopyable {
public:
/// constructor
- template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s): m_type(s.type()) {
- GLint texmodeloc = glGetUniformLocation(Window::shader.program, "texMode");
- GLint texloc = glGetUniformLocation(Window::shader.program, "tex");
- GLint texrectloc = glGetUniformLocation(Window::shader.program, "texrect");
+ template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s, GLuint prog = 0):
+ m_type(s.type()), m_program(prog) {
+ if (m_program == 0) m_program = Window::shader->program; // Default shader
+
+ GLint texmodeloc = glGetUniformLocation(m_program, "texMode");
+ GLint texloc = glGetUniformLocation(m_program, "tex");
+ GLint texrectloc = glGetUniformLocation(m_program, "texrect");
glUniform1i(texloc, 0);
glUniform1i(texrectloc, 1);
@@ -139,13 +142,14 @@ class UseTexture: boost::noncopyable {
glBindTexture(m_type, s.id());
}
~UseTexture() {
- GLint texmodeloc = glGetUniformLocation(Window::shader.program, "texMode");
+ GLint texmodeloc = glGetUniformLocation(m_program, "texMode");
glDisable(m_type);
glUniform1i(texmodeloc, 0);
}
private:
GLenum m_type;
+ GLuint m_program;
};
template <GLenum Type> void OpenGLTexture<Type>::draw(Dimensions const& dim, TexCoords const& tex) const {
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 68621a0..91bdb1e 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -36,7 +36,7 @@ namespace {
unsigned int screenW() { return s_width; }
unsigned int screenH() { return s_height; }
-Shader Window::shader;
+boost::scoped_ptr<Shader> Window::shader;
Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(width), m_windowH(height), m_fullscreen(fs) {
std::atexit(SDL_Quit);
@@ -62,10 +62,8 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
// Extensions would need more complex outputting, otherwise they will break clog.
//std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
- // Joystick etc. initialization
- input::SDL::init();
- // Shaders
- shader = Shader(getThemePath("shaders/core.vert"), getThemePath("shaders/core.frag"));
+ input::SDL::init(); // Joysticks etc.
+ loadShaders(); // Shaders
}
Window::~Window() { }
diff --git a/game/video_driver.hh b/game/video_driver.hh
index 2580e4c..3dc3033 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -1,6 +1,7 @@
#pragma once
#include "glshader.hh"
+#include <boost/scoped_ptr.hpp>
unsigned int screenW();
unsigned int screenH();
@@ -38,7 +39,7 @@ class Window {
/// take a screenshot
void screenshot();
- static Shader shader; // Core shader program for general drawing
+ static boost::scoped_ptr<Shader> shader; ///< core shader used for general drawing
private:
SDL_Surface* screen;
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
new file mode 100644
index 0000000..ae5a802
--- /dev/null
+++ b/themes/default/shaders/3dobject.frag
@@ -0,0 +1,19 @@
+uniform int texMode;
+uniform sampler2D tex;
+uniform sampler2DRect texrect;
+
+void main()
+{
+ vec4 texel;
+ vec4 color;
+ if (texMode == 1) {
+ texel = texture2D(tex, gl_TexCoord[0].st).rgba;
+ } else if (texMode == 2) {
+ texel = texture(texrect, gl_TexCoord[0].st).rgba;
+ } else if (texMode == 0) {
+ texel = gl_Color;
+ } else {
+ texel = vec4(1.0,0.0,0.0,1.0);
+ }
+ gl_FragColor = vec4(texel.rgb*gl_Color.rgb, texel.a*gl_Color.a);
+}
diff --git a/themes/default/shaders/3dobject.vert b/themes/default/shaders/3dobject.vert
new file mode 100644
index 0000000..570a61a
--- /dev/null
+++ b/themes/default/shaders/3dobject.vert
@@ -0,0 +1,7 @@
+void main()
+{
+ gl_FrontColor = gl_Color;
+ gl_BackColor = gl_Color;
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = ftransform();
+}
|
|
From: Tapio V. <aa...@us...> - 2010-11-02 12:08:21
|
Module: performous Branch: opengl2 Commit: 523f78b8f158a2b8d6ec71a18b6b105800f1daa2 Author: Tapio Vierros <tap...@gm...> Date: Tue Nov 2 14:07:37 2010 +0200 Don't dump GL extensions, as they seem to break in clog. --- game/video_driver.cc | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/game/video_driver.cc b/game/video_driver.cc index 2cfd88d..68621a0 100644 --- a/game/video_driver.cc +++ b/game/video_driver.cc @@ -59,7 +59,9 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt std::clog << "video/info: GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl; std::clog << "video/info: GL_VERSION: " << glGetString(GL_VERSION) << std::endl; std::clog << "video/info: GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl; - std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl; + // Extensions would need more complex outputting, otherwise they will break clog. + //std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl; + // Joystick etc. initialization input::SDL::init(); // Shaders |
|
From: Tapio V. <aa...@us...> - 2010-11-02 12:08:19
|
Module: performous
Branch: opengl2
Commit: 14be9cd9ff0485dd9c60147e27f38ddb5ab155b9
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 13:59:00 2010 +0200
Shaders are now loaded from files and much more error reporting.
---
game/glshader.cc | 100 +++++++++++++++++++++++++++++++++-----
game/glshader.hh | 12 ++++-
game/glutil.hh | 1 +
game/video_driver.cc | 37 ++------------
themes/CMakeLists.txt | 4 +-
themes/default/shaders/core.frag | 19 +++++++
themes/default/shaders/core.vert | 7 +++
7 files changed, 132 insertions(+), 48 deletions(-)
diff --git a/game/glshader.cc b/game/glshader.cc
index e0e0bd9..693e253 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -1,32 +1,108 @@
#include "glshader.hh"
#include "glutil.hh"
-Shader::Shader(const char* vertex_shader, const char* fragment_shader) {
+#include <fstream>
+#include <stdexcept>
+
+
+namespace {
+ /// Loads a file into memory
+ std::string loadFile(const std::string& filepath) {
+ std::ifstream f(filepath.c_str(), std::ios::binary);
+ if (!f.is_open()) throw std::runtime_error(std::string("Couldn't open ") + filepath);
+ f.seekg(0, std::ios::end);
+ size_t size = f.tellg();
+ f.seekg(0);
+ std::vector<char> data(size+1); // +1 for terminating null
+ if (!f.read(&data[0], size)) throw std::runtime_error(std::string("Unexpected I/O error in ") + filepath);
+ data.back() = '\0';
+ return std::string(&data[0]);
+ }
+
+ /// Dumps Shader/Program InfoLog
+ void dumpInfoLog(GLuint id) {
+ int infologLength = 0;
+ int maxLength;
+
+ if (glIsShader(id)) glGetShaderiv(id, GL_INFO_LOG_LENGTH, &maxLength);
+ else glGetProgramiv(id, GL_INFO_LOG_LENGTH, &maxLength);
+
+ char infoLog[maxLength];
+
+ if (glIsShader(id)) glGetShaderInfoLog(id, maxLength, &infologLength, infoLog);
+ else glGetProgramInfoLog(id, maxLength, &infologLength, infoLog);
+
+ if (infologLength > 0) {
+ std::cout << std::endl << "Shader info log:" << std::endl;
+ std::cout << infoLog << std::endl;
+ }
+ }
+}
+
+
+Shader::Shader(): program(), vert_shader(), frag_shader() {}
+
+Shader::Shader(const std::string& vert_path, const std::string& frag_path, bool use) {
+ loadFromFile(vert_path, frag_path, use);
+}
+
+
+Shader::~Shader() {
+ glDeleteProgram(program);
+ glDeleteShader(vert_shader);
+ glDeleteShader(frag_shader);
+}
+
+
+void Shader::loadFromFile(const std::string& vert_path, const std::string& frag_path, bool use) {
+ std::string vertstr = loadFile(vert_path);
+ std::string fragstr = loadFile(frag_path);
+ const char* vert = vertstr.c_str();
+ const char* frag = fragstr.c_str();
+ loadFromMemory(vert, frag, use);
+}
+
+
+void Shader::loadFromMemory(const char* vert_source, const char* frag_source, bool use) {
+ glutil::GLErrorChecker::reset();
vert_shader = glCreateShader(GL_VERTEX_SHADER);
frag_shader = glCreateShader(GL_FRAGMENT_SHADER);
+ glutil::GLErrorChecker shadererror("Shader::loadFromMemory - glCreateShader");
- glShaderSource(vert_shader, 1, &vertex_shader, NULL);
- glShaderSource(frag_shader, 1, &fragment_shader, NULL);
+ glShaderSource(vert_shader, 1, &vert_source, NULL);
+ glShaderSource(frag_shader, 1, &frag_source, NULL);
+ glutil::GLErrorChecker shadersourceerror("Shader::loadFromMemory - glShaderSource");
glCompileShader(vert_shader);
- glGetShaderiv(vert_shader,GL_COMPILE_STATUS, &gl_response);
- if (gl_response != GL_TRUE) std::cerr << "Something went wrong compiling the vertex shader." << std::endl;
+ glGetShaderiv(vert_shader, GL_COMPILE_STATUS, &gl_response);
+ if (gl_response != GL_TRUE) {
+ dumpInfoLog(vert_shader);
+ throw std::runtime_error("Something went wrong compiling the vertex shader.");
+ }
glCompileShader(frag_shader);
glGetShaderiv(frag_shader, GL_COMPILE_STATUS, &gl_response);
- if (gl_response != GL_TRUE) std::cerr << "Something went wrong compiling the fragment shader." << std::endl;
+ if (gl_response != GL_TRUE) {
+ dumpInfoLog(frag_shader);
+ throw std::runtime_error("Something went wrong compiling the fragment shader.");
+ }
+ glutil::GLErrorChecker::reset();
program = glCreateProgram();
+ glutil::GLErrorChecker createprogramerror("Shader::loadFromMemory - glCreateProgram");
glAttachShader(program, vert_shader);
glAttachShader(program, frag_shader);
+ glutil::GLErrorChecker attachshadererror("Shader::loadFromMemory - glAttachShader");
glLinkProgram(program);
- glUseProgram(program);
-}
+ glGetProgramiv(program, GL_LINK_STATUS, &gl_response);
+ if (gl_response != GL_TRUE) {
+ dumpInfoLog(program);
+ throw std::runtime_error("Something went wrong linking shader program.");
+ }
+ glutil::GLErrorChecker linkerror("Shader::loadFromMemory - glLinkProgram");
-Shader::~Shader() {
- glDeleteProgram(program);
- glDeleteShader(vert_shader);
- glDeleteShader(frag_shader);
+ if (use) bind();
+ glutil::GLErrorChecker glerror("Shader::loadFromMemory - bind");
}
diff --git a/game/glshader.hh b/game/glshader.hh
index 24b2668..016c601 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -4,10 +4,18 @@
#include <GL/glew.h>
struct Shader {
- Shader(const char* vertex_shader, const char* fragment_shader);
- Shader() {};
+ Shader();
+ Shader(const std::string& vert_path, const std::string& frag_path, bool use = true);
~Shader();
+ /** Loads the shader from files. */
+ void loadFromFile(const std::string& vert_path, const std::string& frag_path, bool use = true);
+ /** Loads the shader from memory. */
+ void loadFromMemory(const char* vert_source, const char* frag_source, bool use = true);
+
+ /** Binds the shader into use. */
+ void bind() { glUseProgram(program); }
+
GLuint program, vert_shader, frag_shader;
int gl_response;
};
diff --git a/game/glutil.hh b/game/glutil.hh
index 58ae55f..44a2837 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -218,6 +218,7 @@ namespace glutil {
}
}
}
+ static void reset() { glGetError(); }
};
}
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 63c193c..2cfd88d 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -31,37 +31,6 @@ namespace {
int m_value;
};
- // FIXME: In general, shaders should be loaded from theme files.
- // Does that apply to these core shaders too?
-
- const char *vertex_glsl =
- "void main()"
- "{"
- " gl_FrontColor = gl_Color;"
- " gl_BackColor = gl_Color;"
- " gl_TexCoord[0] = gl_MultiTexCoord0;"
- " gl_Position = ftransform();"
- "}\000";
-
- const char *fragment_glsl =
- "uniform int texMode;"
- "uniform sampler2D tex;"
- "uniform sampler2DRect texrect;"
- "void main()"
- "{"
- " vec4 texel;"
- " vec4 color;"
- " if (texMode == 1) {"
- " texel = texture2D(tex,gl_TexCoord[0].st).rgba;"
- " } else if (texMode == 2) {"
- " texel = texture(texrect,gl_TexCoord[0].st).rgba;"
- " } else if (texMode == 0) {"
- " texel = gl_Color;"
- " } else {"
- " texel = vec4(1.0,0.0,0.0,1.0);"
- " }"
- " gl_FragColor = vec4(texel.rgb*gl_Color.rgb,texel.a*gl_Color.a);"
- "}\000";
}
unsigned int screenW() { return s_width; }
@@ -90,9 +59,11 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
std::clog << "video/info: GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl;
std::clog << "video/info: GL_VERSION: " << glGetString(GL_VERSION) << std::endl;
std::clog << "video/info: GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl;
- std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
+ std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
+ // Joystick etc. initialization
input::SDL::init();
- shader = Shader(vertex_glsl, fragment_glsl);
+ // Shaders
+ shader = Shader(getThemePath("shaders/core.vert"), getThemePath("shaders/core.frag"));
}
Window::~Window() { }
diff --git a/themes/CMakeLists.txt b/themes/CMakeLists.txt
index 5636f21..800a5f9 100644
--- a/themes/CMakeLists.txt
+++ b/themes/CMakeLists.txt
@@ -1,4 +1,6 @@
FILE(GLOB THEME_FILES "default/*.ogg" "default/*.svg" "default/*.png" "default/*.bmp" "default/*.obj")
+install(FILES ${THEME_FILES} DESTINATION ${SHARE_INSTALL}/themes/default/)
-install( FILES ${THEME_FILES} DESTINATION ${SHARE_INSTALL}/themes/default/)
+FILE(GLOB SHADER_FILES "default/shaders/*.vert" "default/shaders/*.frag")
+install(FILES ${SHADER_FILES} DESTINATION ${SHARE_INSTALL}/themes/default/shaders)
diff --git a/themes/default/shaders/core.frag b/themes/default/shaders/core.frag
new file mode 100644
index 0000000..ae5a802
--- /dev/null
+++ b/themes/default/shaders/core.frag
@@ -0,0 +1,19 @@
+uniform int texMode;
+uniform sampler2D tex;
+uniform sampler2DRect texrect;
+
+void main()
+{
+ vec4 texel;
+ vec4 color;
+ if (texMode == 1) {
+ texel = texture2D(tex, gl_TexCoord[0].st).rgba;
+ } else if (texMode == 2) {
+ texel = texture(texrect, gl_TexCoord[0].st).rgba;
+ } else if (texMode == 0) {
+ texel = gl_Color;
+ } else {
+ texel = vec4(1.0,0.0,0.0,1.0);
+ }
+ gl_FragColor = vec4(texel.rgb*gl_Color.rgb, texel.a*gl_Color.a);
+}
diff --git a/themes/default/shaders/core.vert b/themes/default/shaders/core.vert
new file mode 100644
index 0000000..570a61a
--- /dev/null
+++ b/themes/default/shaders/core.vert
@@ -0,0 +1,7 @@
+void main()
+{
+ gl_FrontColor = gl_Color;
+ gl_BackColor = gl_Color;
+ gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = ftransform();
+}
|
|
From: Tapio V. <aa...@us...> - 2010-11-01 22:22:16
|
Module: performous
Branch: opengl2
Commit: a789431f2f55c242104ba2dc6ac83389b3b4977a
Author: Tapio Vierros <tap...@gm...>
Date: Tue Nov 2 00:19:58 2010 +0200
Verbose logging mode now dumps some info about OpenGL.
---
game/video_driver.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/game/video_driver.cc b/game/video_driver.cc
index b6a837a..63c193c 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -86,6 +86,11 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
SDL_ShowCursor(SDL_DISABLE);
SDL_EnableUNICODE(SDL_ENABLE);
if (glewInit() != GLEW_OK) throw std::runtime_error("Initializing GLEW failed (is your OpenGL broken?)");
+ // Dump some OpenGL info
+ std::clog << "video/info: GL_VENDOR: " << glGetString(GL_VENDOR) << std::endl;
+ std::clog << "video/info: GL_VERSION: " << glGetString(GL_VERSION) << std::endl;
+ std::clog << "video/info: GL_RENDERER: " << glGetString(GL_RENDERER) << std::endl;
+ std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
input::SDL::init();
shader = Shader(vertex_glsl, fragment_glsl);
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-01 19:39:52
|
Module: performous Branch: master Commit: fdf19b9feb2024f6e4ef85eeb326925ca268086f Author: Tapio Vierros <tap...@gm...> Date: Mon Nov 1 21:38:13 2010 +0200 Add ImageMagick to cross-compilation script and enable building of ss_extract and friends. --- win32/cross-from-debian/makebuilddir.sh | 2 +- win32/cross-from-debian/makedeps.sh | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletions(-) diff --git a/win32/cross-from-debian/makebuilddir.sh b/win32/cross-from-debian/makebuilddir.sh index 3c469b9..e68eeb9 100755 --- a/win32/cross-from-debian/makebuilddir.sh +++ b/win32/cross-from-debian/makebuilddir.sh @@ -1,4 +1,4 @@ #!/bin/sh -e mkdir -pv build cd build -exec env PATH="`pwd`/../deps/bin:$PATH" cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain.cmake -DENABLE_TOOLS=OFF -DCMAKE_INSTALL_PREFIX="`pwd`/../stage" "$@" ../../.. +exec env PATH="`pwd`/../deps/bin:$PATH" cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain.cmake -DCMAKE_INSTALL_PREFIX="`pwd`/../stage" "$@" ../../.. diff --git a/win32/cross-from-debian/makedeps.sh b/win32/cross-from-debian/makedeps.sh index b229876..8052d7a 100755 --- a/win32/cross-from-debian/makedeps.sh +++ b/win32/cross-from-debian/makedeps.sh @@ -573,6 +573,21 @@ if test ! -f "$PREFIX"/build-stamps/glew; then $RM_RF $GLEW fi +# ImageMagick +# Needed for tools (ss_extract) only. +IM="ImageMagick-6.6.5-5" +if test ! -f "$PREFIX"/build-stamps/imagemagick; then + download http://image_magick.veidrodis.com/image_magick/ImageMagick-6.6.5-5.tar.bz2 + tar jxvf $IM.tar.bz2 + cd $IM + ./configure $COMMON_AUTOCONF_FLAGS --without-rsvg --without-gslib --without-gvc --without-wmf --without-frozenpaths --without-x + make + make install + cd .. + touch "$PREFIX"/build-stamps/imagemagick + $RM_RF $IM +fi + # liborc LIBORC="orc-0.4.10" if test ! -f "$PREFIX"/build-stamps/liborc; then |
|
From: Tapio V. <aa...@us...> - 2010-11-01 19:39:50
|
Module: performous
Branch: master
Commit: d9d54490813cb18c70c8d3e261024813fe93b2b6
Author: Tapio Vierros <tap...@gm...>
Date: Mon Nov 1 20:07:36 2010 +0200
Added flashMessage when saving configuration.
---
game/screen_intro.cc | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 3d624a9..dd7330d 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -49,9 +49,13 @@ void ScreenIntro::manageEvent(SDL_Event event) {
// These are only available in config menu
int key = event.key.keysym.sym;
SDLMod modifier = event.key.keysym.mod;
- if (key == SDLK_r && modifier & KMOD_CTRL && m_menu.current().value)
+ if (key == SDLK_r && modifier & KMOD_CTRL && m_menu.current().value) {
m_menu.current().value->reset(modifier & KMOD_ALT);
- else if (key == SDLK_s && modifier & KMOD_CTRL) writeConfig(modifier & KMOD_ALT);
+ } else if (key == SDLK_s && modifier & KMOD_CTRL) {
+ writeConfig(modifier & KMOD_ALT);
+ ScreenManager::getSingletonPtr()->flashMessage((modifier & KMOD_ALT)
+ ? _("Settings saved as system defaults.") : _("Settings saved."));
+ }
}
// Animation targets
m_selAnim.setTarget(m_menu.curIndex());
|
|
From: Tapio V. <aa...@us...> - 2010-11-01 18:35:45
|
Module: web Branch: master Commit: 6504139f5c59baec7bdf6e504979ed06a801c084 Author: Tapio Vierros <tap...@gm...> Date: Mon Nov 1 20:34:36 2010 +0200 A new introduction section to better summarize what Performous is about. --- htdocs-source/about.txt | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/htdocs-source/about.txt b/htdocs-source/about.txt index b1e9648..8a0dab4 100644 --- a/htdocs-source/about.txt +++ b/htdocs-source/about.txt @@ -3,6 +3,13 @@ What is it? :~preface:Performous is a free cross-platform music and rhythm game. +:h2:Performous in a nutshell + +Performous is a free party game that originally started as a Linux replacement for SingStar under the name UltraStar-NG, but has since grown into a cross-platform open-source alternative for Rock Band and friends. It even includes a dancing component! + +The core idea in every game mode is to hit the notes scrolling on the screen as accurately as possible. However, Performous doesn't try to clone the other similar games accurately, but walks its own path in many ways - offering for example accurate pitch wave display for singing, unified scoring scheme across songs and game modes plus original features such as webcam background. + +Performous can use and automatically configure most of the instruments/dance pads from other games and supports songs in three formats (UltraStar, FretsOnFire/FoFiX, StepMania). :h2:Karaoke? |
|
From: Tapio V. <aa...@us...> - 2010-10-31 19:55:57
|
Module: performous Branch: master Commit: c11bbf032790a10e2dbf87d514897cfb464cfffb Author: Tapio Vierros <tap...@gm...> Date: Sun Oct 31 21:55:21 2010 +0200 Post-release version increments. --- CMakeLists.txt | 2 +- tools/ppa/ppa.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03f0872..d7bb77c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ project(Performous CXX C) cmake_minimum_required(VERSION 2.6) cmake_policy(VERSION 2.6) -set(PROJECT_VERSION "0.6.1") +set(PROJECT_VERSION "0.6.1+") # Avoid source tree pollution if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) diff --git a/tools/ppa/ppa.sh b/tools/ppa/ppa.sh index 21d2c4d..8f49476 100755 --- a/tools/ppa/ppa.sh +++ b/tools/ppa/ppa.sh @@ -16,7 +16,7 @@ export DEBEMAIL="`gpg --list-keys | grep uid | sed 's/ *(.*)//; s/>.*//; s/.*[:< # Config PKG="performous" -VERSIONCOMMON="0.6.0-99+git"`date '+%Y%m%d'`"~ppa1" +VERSIONCOMMON="0.6.1-99+git"`date '+%Y%m%d'`"~ppa1" SUITES="lucid maverick" GITURL="git://git.performous.org/gitroot/performous/performous" DESTINATIONPPA="ppa:performous-team/ppa" |
|
From: Tapio V. <aa...@us...> - 2010-10-31 16:01:49
|
Module: performous Branch: refs/tags/0.6.1 Tag: 3d0b170defca3c277251d722dbfc1c5280c124ee Tagger: Tapio Vierros <tap...@gm...> Date: Sun Oct 31 18:00:18 2010 +0200 0.6.1 release |
|
From: Tapio V. <aa...@us...> - 2010-10-31 15:56:59
|
Module: web Branch: master Commit: 377993256dab7aafad6ab6ecad3e4cb9f14d0003 Author: Tapio Vierros <tap...@gm...> Date: Sun Oct 31 17:56:20 2010 +0200 Update new version to download links. --- htdocs-source/install.txt | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs-source/install.txt b/htdocs-source/install.txt index d3d7d44..1d96b64 100644 --- a/htdocs-source/install.txt +++ b/htdocs-source/install.txt @@ -8,7 +8,7 @@ If you have problems, please have a look at the <a href="http://wiki.performous. :h2:Windows - WinXP or better: <a href="https://sourceforge.net/projects/performous/files/performous/0.6.0/Performous-0.6.0.exe/download">installer</a> + WinXP or better: <a href="https://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1.exe/download">installer</a> <em>Note:</em> You can find new features and bugfixes in the <a href=http://wiki.performous.org/index.php/Nightly_Builds>testing builds</a>. :h2:Mac OS X @@ -34,7 +34,7 @@ If you get an error about unsatisfied dependencies on Ubuntu, you may have to en :h2:Other systems and development version - Source code (v0.6.0): <a href="http://sourceforge.net/projects/performous/files/performous/0.6.0/Performous-0.6.0-Source.tar.bz2/download">universal</a> + Source code (v0.6.1): <a href="http://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1-Source.tar.bz2/download">universal</a> The very latest source code is available in our Git repository. See the <a href="http://wiki.performous.org/index.php/Developing">development wiki pages</a> for more information. |