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-08 22:24:39
|
Module: performous
Branch: opengl2
Commit: f044d768ca78479da8bbf55459ed7bcc4374ea2d
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 7 23:22:28 2010 +0200
No more static Shaders.
---
game/3dobject.cc | 2 --
game/3dobject.hh | 3 ---
game/dancegraph.cc | 7 +++----
game/dancegraph.hh | 3 ---
game/glshader.cc | 13 -------------
game/glshader.hh | 4 ----
game/guitargraph.cc | 5 +++++
game/instrumentgraph.hh | 4 ++++
game/screen_intro.cc | 4 ++--
game/theme.cc | 5 ++---
game/theme.hh | 2 +-
game/video_driver.cc | 4 +---
game/video_driver.hh | 3 +--
13 files changed, 19 insertions(+), 40 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index 0b0b1f6..c3b4418 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -24,8 +24,6 @@ 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) {
int linenumber = 0;
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 834cb28..ef99f11 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -70,7 +70,6 @@ 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);
drawVBO();
@@ -78,6 +77,4 @@ class Object3d: boost::noncopyable {
drawVBO();
}
}
-
- static boost::scoped_ptr<Shader> shader; ///< shader used for 3d objects
};
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 2afc030..f37ed39 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -78,8 +78,6 @@ namespace {
}
-boost::scoped_ptr<Shader> DanceGraph::shader_note;
-
/// Constructor
DanceGraph::DanceGraph(Audio& audio, Song const& song):
InstrumentGraph(audio, song, input::DANCEPAD),
@@ -92,6 +90,7 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_flow_direction(1),
m_insideStop()
{
+ m_shader_note.reset(new Shader(getThemePath("shaders/dancenote.vert"), getThemePath("shaders/dancenote.frag")));
// Initialize some arrays
for (size_t i = 0; i < max_panels; i++) {
m_activeNotes[i] = m_notes.end();
@@ -428,7 +427,7 @@ void DanceGraph::draw(double time) {
// Arrows on cursor
{
- UseShader us(*DanceGraph::shader_note);
+ UseShader us(*m_shader_note);
us().setUniform("clock", float(time))
.setUniform("noteType", 0)
.setUniform("scale", getScale());
@@ -491,7 +490,7 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
double glow = note.hitAnim.get();
{
- UseShader us(*DanceGraph::shader_note);
+ UseShader us(*m_shader_note);
us().setUniform("hitAnim", float(glow))
.setUniform("clock", float(time))
.setUniform("scale", getScale());
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index f229462..5753703 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -37,9 +37,6 @@ class DanceGraph: public InstrumentGraph {
void changeTrack(int dir = 1);
void changeDifficulty(int dir = 1);
- // Shaders
- static boost::scoped_ptr<Shader> shader_note; /// note/arrow/mine etc. shader
-
private:
// Difficulty & mode selection
enum DanceStep { STEP_LEFT, STEP_DOWN, STEP_UP, STEP_RIGHT };
diff --git a/game/glshader.cc b/game/glshader.cc
index 0297beb..69f3928 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -1,10 +1,5 @@
#include "glshader.hh"
#include "glutil.hh"
-#include "video_driver.hh"
-#include "3dobject.hh"
-#include "theme.hh"
-#include "fs.hh"
-#include "dancegraph.hh"
#include <fstream>
#include <stdexcept>
@@ -129,11 +124,3 @@ GLint Shader::operator[](const std::string& uniform) {
it->second = glGetUniformLocation(program, uniform.c_str());
return it->second;
}
-
-
-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")));
- ThemeIntro::shader.reset(new Shader(getThemePath("shaders/intro.vert"), getThemePath("shaders/intro.frag")));
- DanceGraph::shader_note.reset(new Shader(getThemePath("shaders/dancenote.vert"), getThemePath("shaders/dancenote.frag")));
-}
diff --git a/game/glshader.hh b/game/glshader.hh
index 2a4e890..73e0a11 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -88,7 +88,3 @@ struct UseShader {
Shader& m_shader;
GLint m_old;
};
-
-
-/** Load shaders. */
-void loadShaders();
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index ad04389..3ee2b9f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -89,6 +89,7 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number,
m_practHold(false),
m_whammy(0)
{
+ m_shader_note.reset(new Shader(getThemePath("shaders/3dobject.vert"), getThemePath("shaders/3dobject.frag")));
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
std::string index = it->first;
@@ -1039,6 +1040,7 @@ void GuitarGraph::drawNote(int fret, Color color, float tBeg, float tEnd, float
color.a = clamp(time2a(tBeg)*2.0f,0.0f,1.0f);
{
glutil::Color c(color);
+ UseShader us(*m_shader_note); // Switch shader
m_fretObj.draw(x, y, 0.0f);
}
y -= fretWid;
@@ -1077,12 +1079,14 @@ void GuitarGraph::drawNote(int fret, Color color, float tBeg, float tEnd, float
color.a = s;
{
glutil::Color c(color);
+ UseShader us(*m_shader_note); // Switch shader
m_fretObj.draw(x, yBeg, 0.0f, s);
}
} else {
color.a = clamp(time2a(tBeg)*2.0f,0.0f,1.0f);
{
glutil::Color c(color);
+ UseShader us(*m_shader_note); // Switch shader
m_fretObj.draw(x, yBeg, 0.0f);
}
}
@@ -1101,6 +1105,7 @@ void GuitarGraph::drawNote(int fret, Color color, float tBeg, float tEnd, float
if (m_use3d) { // 3D
float s = 1.0 - hitAnim;
glutil::Color c(Color(l, l, l, s));
+ UseShader us(*m_shader_note); // Switch shader
m_tappableObj.draw(x, yBeg, 0.0f, s);
} else { // 2D
glutil::Color c(Color(l, l, l));
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 7b6fd77..0c6e050 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -13,6 +13,7 @@
#include "screen.hh"
#include "fs.hh"
#include "theme.hh"
+#include "glshader.hh"
/// Represents popup messages
@@ -135,6 +136,9 @@ class InstrumentGraph {
boost::scoped_ptr<SvgTxtThemeSimple> m_popupText;
boost::scoped_ptr<ThemeInstrumentMenu> m_menuTheme;
+ // Shaders
+ boost::scoped_ptr<Shader> m_shader_note;
+
// Dynamic stuff for join menu
ConfigItem m_selectedTrack; /// menu modifies this to select track
ConfigItem m_selectedDifficulty; /// menu modifies this to select difficulty
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 283e95b..69b8947 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -114,9 +114,9 @@ void ScreenIntro::draw_menu_options() {
void ScreenIntro::draw() {
{
- UseShader s(*ThemeIntro::shader);
+ UseShader us(*theme->bg_shader);
float anim = std::abs((((SDL_GetTicks() % 10000) / 10000.f) - 0.5f) * 2.0f);
- s().setUniform("anim", anim);
+ us().setUniform("anim", anim);
theme->bg.draw();
}
if (m_menu.current().image) m_menu.current().image->draw();
diff --git a/game/theme.cc b/game/theme.cc
index b07051d..db4e086 100644
--- a/game/theme.cc
+++ b/game/theme.cc
@@ -44,8 +44,6 @@ ThemeAudioDevices::ThemeAudioDevices():
comment_bg(getThemePath("mainmenu_comment_bg.svg"))
{}
-boost::scoped_ptr<Shader> ThemeIntro::shader;
-
ThemeIntro::ThemeIntro():
Theme(getThemePath("intro_bg.svg")),
back_h(getThemePath("mainmenu_back_highlight.svg")),
@@ -54,7 +52,8 @@ ThemeIntro::ThemeIntro():
comment(getThemePath("mainmenu_comment.svg"), config["graphic/text_lod"].f()),
short_comment(getThemePath("mainmenu_short_comment.svg"), config["graphic/text_lod"].f()),
comment_bg(getThemePath("mainmenu_comment_bg.svg")),
- short_comment_bg(getThemePath("mainmenu_scomment_bg.svg"))
+ short_comment_bg(getThemePath("mainmenu_scomment_bg.svg")),
+ bg_shader(new Shader(getThemePath("shaders/intro.vert"), getThemePath("shaders/intro.frag")))
{
back_h.dimensions.fixedHeight(0.08f);
}
diff --git a/game/theme.hh b/game/theme.hh
index ac9bd48..e386564 100644
--- a/game/theme.hh
+++ b/game/theme.hh
@@ -95,7 +95,7 @@ public:
/// configuration comment background (short tip)
Surface short_comment_bg;
/// Custom background shader
- static boost::scoped_ptr<Shader> shader;
+ boost::scoped_ptr<Shader> bg_shader;
};
/// theme for instrument menu
diff --git a/game/video_driver.cc b/game/video_driver.cc
index 91bdb1e..c501639 100644
--- a/game/video_driver.cc
+++ b/game/video_driver.cc
@@ -36,8 +36,6 @@ namespace {
unsigned int screenW() { return s_width; }
unsigned int screenH() { return s_height; }
-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);
if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK) == -1 ) throw std::runtime_error("SDL_Init failed");
@@ -63,7 +61,7 @@ Window::Window(unsigned int width, unsigned int height, bool fs): m_windowW(widt
//std::clog << "video/info: GL_EXTENSIONS: " << glGetString(GL_EXTENSIONS) << std::endl;
input::SDL::init(); // Joysticks etc.
- loadShaders(); // Shaders
+ m_shader.reset(new Shader(getThemePath("shaders/core.vert"), getThemePath("shaders/core.frag"), true));
}
Window::~Window() { }
diff --git a/game/video_driver.hh b/game/video_driver.hh
index 3dc3033..79c24c9 100644
--- a/game/video_driver.hh
+++ b/game/video_driver.hh
@@ -39,12 +39,11 @@ class Window {
/// take a screenshot
void screenshot();
- static boost::scoped_ptr<Shader> shader; ///< core shader used for general drawing
-
private:
SDL_Surface* screen;
unsigned int m_windowW, m_windowH;
unsigned int m_fsW, m_fsH;
bool m_fullscreen;
+ boost::scoped_ptr<Shader> m_shader; ///< core shader used for general drawing
};
|
|
From: Tapio V. <aa...@us...> - 2010-11-08 14:47:27
|
Module: performous
Branch: opengl2
Commit: a49d0c8a1c4ed2aeade2283b51b7fec64bcf77c3
Author: Tapio Vierros <tap...@gm...>
Date: Mon Nov 8 16:46:41 2010 +0200
GLSL driver compatibility fix.
---
themes/default/shaders/dancenote.vert | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/themes/default/shaders/dancenote.vert b/themes/default/shaders/dancenote.vert
index 60a4d61..3573391 100644
--- a/themes/default/shaders/dancenote.vert
+++ b/themes/default/shaders/dancenote.vert
@@ -46,7 +46,7 @@ void main()
// Mines
} else if (noteType == 3) {
trans *= scaleMat(1.0 + hitAnim);
- float r = float(mod(int(clock*360), 360)) * deg2rad; // They rotate!
+ float r = float(mod(int(clock*360.0), 360)) * deg2rad; // They rotate!
trans *= rotMat(r);
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-07 20:32:00
|
Module: performous
Branch: opengl2
Commit: d3a18ed135513665931440d787cce409a443b2ac
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 7 22:30:42 2010 +0200
Vertex shader now handles dance note positioning instead of glTranslatef.
---
game/dancegraph.cc | 14 ++++----------
themes/default/shaders/dancenote.vert | 4 +++-
2 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 7488dc0..2afc030 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -433,12 +433,9 @@ void DanceGraph::draw(double time) {
.setUniform("noteType", 0)
.setUniform("scale", getScale());
for (int arrow_i = 0; arrow_i < m_pads; ++arrow_i) {
- float x = panel2x(arrow_i);
- float y = time2y(0.0);
float l = m_pressed_anim[arrow_i].get();
- us().setUniform("hitAnim", float(l));
- glutil::PushMatrix pm;
- glTranslatef(x, y, 0.0f);
+ us().setUniform("hitAnim", l)
+ .setUniform("position", panel2x(arrow_i), time2y(0.0));
drawArrow(arrow_i, m_arrows_cursor);
}
}
@@ -494,7 +491,6 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
double glow = note.hitAnim.get();
{
- glutil::PushMatrix pm;
UseShader us(*DanceGraph::shader_note);
us().setUniform("hitAnim", float(glow))
.setUniform("clock", float(time))
@@ -502,13 +498,12 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
if (yEnd - yBeg > arrowSize) {
// Draw holds
- us().setUniform("noteType", 2);
if (note.isHit && note.releaseTime <= 0) { // The note is being held down
yBeg = std::max(time2y(0.0), yBeg);
yEnd = std::max(time2y(0.0), yEnd);
}
if (note.releaseTime > 0) yBeg = time2y(note.releaseTime - time); // Oh noes, it got released!
- glTranslatef(x, yBeg, 0.0f); // Move to place
+ us().setUniform("noteType", 2).setUniform("position", x, yBeg);
// Draw begin
drawArrow(arrow_i, m_arrows_hold, 0.0f, 1.0f/3.0f);
if (yEnd - yBeg > 0) {
@@ -525,9 +520,8 @@ void DanceGraph::drawNote(DanceNote& note, double time) {
}
} else {
// Draw short note
- us().setUniform("noteType", (mine ? 3 : 1));
if (mine && note.isHit) yBeg = time2y(0.0);
- glTranslatef(x, yBeg, 0.0f); // Move to place
+ us().setUniform("noteType", (mine ? 3 : 1)).setUniform("position", x, yBeg);
drawArrow((mine ? -1 : arrow_i), (mine ? m_mine : m_arrows));
}
}
diff --git a/themes/default/shaders/dancenote.vert b/themes/default/shaders/dancenote.vert
index 0b1be7c..60a4d61 100644
--- a/themes/default/shaders/dancenote.vert
+++ b/themes/default/shaders/dancenote.vert
@@ -2,6 +2,7 @@ uniform int noteType;
uniform float hitAnim;
uniform float clock;
uniform float scale;
+uniform vec2 position;
#define deg2rad 0.0174532925
@@ -45,10 +46,11 @@ void main()
// Mines
} else if (noteType == 3) {
trans *= scaleMat(1.0 + hitAnim);
- float r = (int(clock*360) % 360) * deg2rad; // They rotate!
+ float r = float(mod(int(clock*360), 360)) * deg2rad; // They rotate!
trans *= rotMat(r);
}
gl_Position = gl_ModelViewProjectionMatrix * trans * gl_Vertex;
+ gl_Position += gl_ModelViewProjectionMatrix * vec4(position.xy, 0, 0);
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-07 20:31:55
|
Module: performous
Branch: opengl2
Commit: c060f0841aa653f59d45e3f5cfebc5c12a471de3
Author: Tapio Vierros <tap...@gm...>
Date: Sun Nov 7 22:10:22 2010 +0200
Add more setUniform()s to Shader class.
---
game/glshader.hh | 29 +++++++++++++++++++++++------
1 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/game/glshader.hh b/game/glshader.hh
index 7aa0ec1..2a4e890 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -25,12 +25,28 @@ struct Shader: public boost::noncopyable {
/** Allow setting uniforms in a chain. Shader needs to be in use.*/
Shader& setUniform(const std::string& uniform, int value) {
- glUniform1i((*this)[uniform], value);
- return *this;
+ glUniform1i((*this)[uniform], value); return *this;
}
Shader& setUniform(const std::string& uniform, float value) {
- glUniform1f((*this)[uniform], value);
- return *this;
+ glUniform1f((*this)[uniform], value); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, int x, int y) {
+ glUniform2i((*this)[uniform], x, y); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, float x, float y) {
+ glUniform2f((*this)[uniform], x, y); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, int x, int y, int z) {
+ glUniform3i((*this)[uniform], x, y, z); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, float x, float y, float z) {
+ glUniform3f((*this)[uniform], x, y, z); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, int x, int y, int z, int w) {
+ glUniform4i((*this)[uniform], x, y, z, w); return *this;
+ }
+ Shader& setUniform(const std::string& uniform, float x, float y, float z, float w) {
+ glUniform4f((*this)[uniform], x, y, z, w); return *this;
}
// Some operators
@@ -38,6 +54,8 @@ struct Shader: public boost::noncopyable {
bool operator==(const Shader& rhs) const { return program == rhs.program; }
bool operator!=(const Shader& rhs) const { return program != rhs.program; }
+ GLuint program, vert_shader, frag_shader; ///< shader object ids
+
/** Returns pointer to the currently used shader. */
static Shader* current() {
GLint i;
@@ -45,10 +63,9 @@ struct Shader: public boost::noncopyable {
return shaders[i];
}
- GLuint program, vert_shader, frag_shader; ///< shader object ids
+ private:
int gl_response;
- private:
typedef std::map<std::string, GLint> UniformMap;
UniformMap uniforms; ///< Cached uniform locations, use operator[] to access
|
|
From: Tapio V. <aa...@us...> - 2010-11-07 20:31:54
|
Module: performous Branch: opengl2 Commit: 00c36c6dbc51bdba21f8d4375f1ce1a749d8900f Author: Tapio Vierros <tap...@gm...> Date: Sun Nov 7 22:04:25 2010 +0200 Dance arrow animations are now handled by a shader. --- game/dancegraph.cc | 145 ++++++++++++++------------------- game/dancegraph.hh | 8 +- game/glshader.cc | 2 + themes/default/shaders/core.vert | 2 +- themes/default/shaders/dancenote.frag | 42 ++++++++++ themes/default/shaders/dancenote.vert | 54 ++++++++++++ themes/default/shaders/intro.vert | 2 +- 7 files changed, 167 insertions(+), 88 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-11-06 20:15:54
|
Module: performous
Branch: opengl2
Commit: cfe6eff49fddca2f26de2578cecc828d3aea59ea
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 6 21:10:53 2010 +0200
Shader object can be accessed from UseShader.
---
game/glshader.hh | 7 +++++--
game/screen_intro.cc | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/game/glshader.hh b/game/glshader.hh
index 1499654..7aa0ec1 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -59,13 +59,16 @@ struct Shader: public boost::noncopyable {
/** Temporarily switch shader in a RAII manner. */
struct UseShader {
- UseShader(Shader& new_shader) {
+ UseShader(Shader& new_shader): m_shader(new_shader) {
glGetIntegerv(GL_CURRENT_PROGRAM, &m_old);
- new_shader.bind();
+ m_shader.bind();
}
~UseShader() { glUseProgram(m_old); }
+ /// Access the bound shader
+ Shader& operator()() { return m_shader; }
private:
+ Shader& m_shader;
GLint m_old;
};
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index ccca31b..283e95b 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -116,7 +116,7 @@ void ScreenIntro::draw() {
{
UseShader s(*ThemeIntro::shader);
float anim = std::abs((((SDL_GetTicks() % 10000) / 10000.f) - 0.5f) * 2.0f);
- ThemeIntro::shader->setUniform("anim", anim);
+ s().setUniform("anim", anim);
theme->bg.draw();
}
if (m_menu.current().image) m_menu.current().image->draw();
|
|
From: Tapio V. <aa...@us...> - 2010-11-06 20:15:51
|
Module: performous
Branch: opengl2
Commit: 801c43948ef51a3c5a24710c5e0b1ce508da07ac
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 6 21:06:57 2010 +0200
Provide a nice interface for uniforms in Shader class.
---
game/glshader.cc | 15 ++++++++-------
game/glshader.hh | 28 ++++++++++++++++++++++------
game/screen_intro.cc | 2 +-
game/surface.hh | 11 +++++------
4 files changed, 36 insertions(+), 20 deletions(-)
diff --git a/game/glshader.cc b/game/glshader.cc
index 3d0f965..3a38510 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -53,6 +53,7 @@ Shader::Shader(const std::string& vert_path, const std::string& frag_path, bool
Shader::~Shader() {
+ shaders[program] = NULL;
glDeleteProgram(program);
glDeleteShader(vert_shader);
glDeleteShader(frag_shader);
@@ -109,13 +110,6 @@ 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");
- anim = glGetUniformLocation(program, "anim");
- glutil::GLErrorChecker uniformerror("Shader::loadFromMemory - glGetUniformLocation");
-
shaders[program] = this;
if (use) bind();
@@ -128,6 +122,13 @@ void Shader::bind() {
}
+GLint Shader::operator[](const std::string& uniform) {
+ UniformMap::iterator it = uniforms.find(uniform);
+ if (it == uniforms.end())
+ it->second = glGetUniformLocation(program, uniform.c_str());
+ return it->second;
+}
+
void loadShaders() {
Window::shader.reset(new Shader(getThemePath("shaders/core.vert"), getThemePath("shaders/core.frag"), true));
diff --git a/game/glshader.hh b/game/glshader.hh
index 71c285d..1499654 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -19,11 +19,19 @@ struct Shader: public boost::noncopyable {
/** Binds the shader into use. */
void bind();
- GLuint program, vert_shader, frag_shader; ///< shader object ids
- // TODO: Should probably use an std::map for these and cache on-the-fly/on-demand.
- // Also provide a nice access to setting the uniform.
- GLint tex, texRect, texMode, anim; ///< uniform locations
- int gl_response;
+ /** Get uniform location. Uses caching internally. */
+ GLint operator[](const std::string& uniform);
+
+ /** Allow setting uniforms in a chain. Shader needs to be in use.*/
+
+ Shader& setUniform(const std::string& uniform, int value) {
+ glUniform1i((*this)[uniform], value);
+ return *this;
+ }
+ Shader& setUniform(const std::string& uniform, float value) {
+ glUniform1f((*this)[uniform], value);
+ return *this;
+ }
// Some operators
operator bool() const { return program != 0; }
@@ -37,8 +45,15 @@ struct Shader: public boost::noncopyable {
return shaders[i];
}
+ GLuint program, vert_shader, frag_shader; ///< shader object ids
+ int gl_response;
+
+ private:
+ typedef std::map<std::string, GLint> UniformMap;
+ UniformMap uniforms; ///< Cached uniform locations, use operator[] to access
+
typedef std::map<GLint, Shader*> ShaderMap;
- static ShaderMap shaders;
+ static ShaderMap shaders; ///< Shader objects for reverse look-up by id
};
@@ -49,6 +64,7 @@ struct UseShader {
new_shader.bind();
}
~UseShader() { glUseProgram(m_old); }
+
private:
GLint m_old;
};
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index 61e9023..ccca31b 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -116,7 +116,7 @@ void ScreenIntro::draw() {
{
UseShader s(*ThemeIntro::shader);
float anim = std::abs((((SDL_GetTicks() % 10000) / 10000.f) - 0.5f) * 2.0f);
- glUniform1f(ThemeIntro::shader->anim, anim);
+ ThemeIntro::shader->setUniform("anim", anim);
theme->bg.draw();
}
if (m_menu.current().image) m_menu.current().image->draw();
diff --git a/game/surface.hh b/game/surface.hh
index 2a9ef6b..f173515 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -122,19 +122,18 @@ class UseTexture: boost::noncopyable {
/// constructor
template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s):
m_shader(*Shader::current()) {
- glUniform1i(m_shader.tex, 0);
- glUniform1i(m_shader.texRect, 1);
+ m_shader.setUniform("tex", 0).setUniform("texRect", 1);
switch (Type) {
- 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;
+ case GL_TEXTURE_2D: glActiveTexture(GL_TEXTURE0); m_shader.setUniform("texMode", 1); break;
+ case GL_TEXTURE_RECTANGLE_ARB: glActiveTexture(GL_TEXTURE0+1); m_shader.setUniform("texMode", 2); break;
+ default: m_shader.setUniform("texMode", 3); break;
}
glBindTexture(Type, s.id());
}
~UseTexture() {
- glUniform1i(m_shader.texMode, 0);
+ m_shader.setUniform("texMode", 0);
}
private:
|
|
From: Tapio V. <aa...@us...> - 2010-11-06 20:15:48
|
Module: performous
Branch: opengl2
Commit: 02e56deb7340342349093461e95c82f8f10ec73d
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 6 20:26:27 2010 +0200
Expand VerexArray class and use it to draw notegraph waves.
Improves consistency and avoids "re-inventing the wheel".
---
game/fbo.hh | 3 ++-
game/glutil.hh | 40 ++++++++++++++++++++++------------------
game/notegraph.cc | 41 +++++++++++++++++------------------------
3 files changed, 41 insertions(+), 43 deletions(-)
diff --git a/game/fbo.hh b/game/fbo.hh
index 4199393..ded4f84 100644
--- a/game/fbo.hh
+++ b/game/fbo.hh
@@ -1,9 +1,10 @@
#pragma once
+#include <boost/noncopyable.hpp>
#include "video_driver.hh"
/// Frame Buffer Object class
-class FBO {
+class FBO: public boost::noncopyable {
public:
/// Generate the FBO and attach a fresh texture to it
FBO(): m_texture() {
diff --git a/game/glutil.hh b/game/glutil.hh
index c8e3a06..f25abe1 100644
--- a/game/glutil.hh
+++ b/game/glutil.hh
@@ -11,20 +11,6 @@
namespace glutil {
- struct Point {
- float vx;
- float vy;
- Point(float vx_, float vy_): vx(vx_), vy(vy_) {}
- };
-
- struct tPoint {
- float tx;
- float ty;
- float vx;
- float vy;
- tPoint(float tx_, float ty_, float vx_, float vy_): tx(tx_), ty(ty_), vx(vx_), vy(vy_) {}
- };
-
/// wrapper struct for RAII
struct PushMatrix {
PushMatrix() { glPushMatrix(); }
@@ -75,6 +61,7 @@ namespace glutil {
operator float const*() const { return reinterpret_cast<float const*>(this); }
};
+ /// handy vertex array capable of drawing itself
class VertexArray {
private:
int m_dimension;
@@ -84,6 +71,8 @@ namespace glutil {
std::vector<float> m_colors;
public:
+ VertexArray(): m_dimension(1) {}
+
VertexArray& Vertex(float x, float y) {
m_dimension = 2;
m_vertices.push_back(x);
@@ -120,7 +109,7 @@ namespace glutil {
return *this;
}
- VertexArray& Color(glutil::Color& c) {
+ VertexArray& Color(const glutil::Color& c) {
m_colors.push_back(c.r);
m_colors.push_back(c.g);
m_colors.push_back(c.b);
@@ -128,7 +117,7 @@ namespace glutil {
return *this;
}
- void Draw(GLint mode = GL_TRIANGLE_STRIP) {
+ void Draw(GLint mode = GL_TRIANGLE_STRIP) const {
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(m_dimension, GL_FLOAT, 0, &m_vertices.front());
if (m_texcoords.size()) {
@@ -143,7 +132,7 @@ namespace glutil {
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(4, GL_FLOAT, 0, &m_colors.front());
}
- glDrawArrays(mode, 0, m_vertices.size()/m_dimension);
+ glDrawArrays(mode, 0, size());
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
@@ -151,7 +140,22 @@ namespace glutil {
glDisableClientState(GL_VERTEX_ARRAY);
}
- VertexArray() {}
+ bool empty() const {
+ return m_vertices.empty() && m_normals.empty() && m_texcoords.empty() && m_colors.empty();
+ }
+
+ unsigned size() const {
+ return m_vertices.size() / m_dimension;
+ }
+
+ void clear() {
+ m_vertices.clear(); m_normals.clear(); m_texcoords.clear(); m_colors.clear();
+ }
+
+ std::vector<float>& getVertices() { return m_vertices; }
+ std::vector<float>& getNormals() { return m_normals; }
+ std::vector<float>& getTexCoords() { return m_texcoords; }
+ std::vector<float>& getColors() { return m_colors; }
};
/// easy line
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 2ab1e6a..dc00199 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -183,26 +183,19 @@ void NoteGraph::drawNotes() {
}
namespace {
- void strip(std::vector<glutil::tPoint>& points) {
- size_t s = points.size();
- if (s > 3) {
+ void strip(glutil::VertexArray& va) {
+ if (va.size() > 3) {
// Combine the two last points into a terminating point
- {
- glutil::tPoint& p = points[s-2];
- p.ty = 0.5f;
- p.vy = 0.5f * (p.vy + points[s-1].vy);
- }
- points.pop_back();
- // Render them as a triangle stripe
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glTexCoordPointer(2, GL_FLOAT, sizeof(glutil::tPoint), &points.front().tx);
- glVertexPointer(2, GL_FLOAT, sizeof(glutil::tPoint), &points.front().vx);
- glDrawArrays(GL_TRIANGLE_STRIP, 0, points.size());
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_VERTEX_ARRAY);
+ size_t s = va.getVertices().size();
+ va.getTexCoords()[s-3] = 0.5f; // y of second-to-last texcoord
+ float& vy = va.getVertices()[s-3]; // y of second-to-last vertex
+ vy = 0.5f * (vy + va.getVertices()[s-1]); // here is y of last vertex
+ va.getVertices().pop_back();
+ va.getTexCoords().pop_back();
+ // Now ready to draw
+ va.Draw();
}
- points.clear();
+ va.clear();
}
}
@@ -222,7 +215,7 @@ void NoteGraph::drawWaves(Database const& database) {
float tex = texOffset;
double t = idx * Engine::TIMESTEP;
double oldval = getNaN();
- std::vector<glutil::tPoint> points;
+ glutil::VertexArray va;
Notes::const_iterator noteIt = m_vocal.notes.begin();
glutil::Color c(Color(p->m_color.r, p->m_color.g, p->m_color.b, m_notealpha));
for (; idx < endIdx; ++idx, t += Engine::TIMESTEP) {
@@ -250,16 +243,16 @@ void NoteGraph::drawWaves(Database const& database) {
thickness *= 1.0 + 0.2 * std::sin(tex - 2.0 * texOffset); // Further animation :)
thickness *= -m_noteUnit;
// If there has been a break or if the pitch change is too fast, terminate and begin a new one
- if (oldval != oldval || std::abs(oldval - val) > 1) strip(points);
+ if (oldval != oldval || std::abs(oldval - val) > 1) strip(va);
// Add a point or a pair of points
- if (points.empty()) points.push_back(glutil::tPoint(tex, 0.5f, x, y));
+ if (!va.size()) va.TexCoord(tex, 0.5f).Vertex(x, y);
else {
- points.push_back(glutil::tPoint(tex, 0.0f, x, y - thickness));
- points.push_back(glutil::tPoint(tex, 1.0f, x, y + thickness));
+ va.TexCoord(tex, 0.0f).Vertex(x, y - thickness);
+ va.TexCoord(tex, 1.0f).Vertex(x, y + thickness);
}
oldval = val;
}
- strip(points);
+ strip(va);
}
//glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-06 13:24:29
|
Module: performous
Branch: opengl2
Commit: 1e9ac7e1854b14778cfc5133c17a6f36ff9d66b9
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 6 15:23:18 2010 +0200
Preparations for rendering everything to FBO; doesn't work yet though.
---
game/main.cc | 3 +--
game/screen.hh | 6 +++++-
game/screenmanager.cc | 13 ++++++++++++-
3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index f8de5de..a5df358 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -178,8 +178,7 @@ void mainLoop(std::string const& songlist) {
try {
// Draw
window.blank();
- sm.getCurrentScreen()->draw();
- sm.drawNotifications();
+ sm.drawScreen();
prof("draw");
// Display (and wait until next frame)
window.swap();
diff --git a/game/screen.hh b/game/screen.hh
index 91b663c..b0c053c 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -5,6 +5,7 @@
#include "opengl_text.hh"
#include "video_driver.hh"
#include "dialog.hh"
+#include "fbo.hh"
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/scoped_ptr.hpp>
#include <SDL.h>
@@ -46,6 +47,8 @@ class ScreenManager: public Singleton <ScreenManager> {
void activateScreen(std::string const& name);
/// Does actual switching of screens (if necessary)
void updateScreen();
+ /// Draws the current screen and possible transition effects
+ void drawScreen();
/// Returns pointer to current Screen
Screen* getCurrentScreen() { return currentScreen; };
/// Returns pointer to Screen for given name
@@ -65,7 +68,7 @@ class ScreenManager: public Singleton <ScreenManager> {
bool closeDialog();
/// Returns true if dialog is open
bool isDialogOpen() { return m_dialog; }
- /// Draw dialogs & flash messages in current screen
+ /// Draw dialogs & flash messages, called automatically by drawScreen
void drawNotifications();
/// Sets finished to true
@@ -75,6 +78,7 @@ class ScreenManager: public Singleton <ScreenManager> {
private:
Window& m_window;
+ FBO m_fbo;
bool m_finished;
typedef boost::ptr_map<std::string, Screen> screenmap_t;
screenmap_t screens;
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index 640a678..f0c721c 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -12,7 +12,7 @@
template<> ScreenManager* Singleton<ScreenManager>::ms_Singleton = NULL;
ScreenManager::ScreenManager(Window& _window):
- m_window(_window), m_finished(false), newScreen(), currentScreen(),
+ m_window(_window), m_fbo(), m_finished(false), newScreen(), currentScreen(),
m_timeToFadeIn(), m_timeToFadeOut(), m_timeToShow(), m_message(),
m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("message_text.svg"), config["graphic/text_lod"].f())
@@ -41,6 +41,17 @@ Screen* ScreenManager::getScreen(std::string const& name) {
}
}
+void ScreenManager::drawScreen() {
+ // FIXME: Rendering using FBO doesn't work
+ {
+ //UseFBO fbo(m_fbo);
+ getCurrentScreen()->draw();
+ drawNotifications();
+ }
+ //m_fbo.getTexture().draw(Dimensions().fixedWidth(1.0));
+}
+
+
void ScreenManager::loading(std::string const& message, float progress) {
// TODO: Create a better one, this is quite ugly
flashMessage(message + " " + boost::lexical_cast<std::string>(int(round(progress*100))) + "%", 0.0f, 1.0f, 1.0f);
|
|
From: Tapio V. <aa...@us...> - 2010-11-06 13:24:26
|
Module: performous
Branch: opengl2
Commit: 5c22b0385edcf3fe5d98a13aed4da2dd3b31c932
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 6 15:22:29 2010 +0200
Preliminary Frame Buffer Object class.
---
game/fbo.hh | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/game/fbo.hh b/game/fbo.hh
new file mode 100644
index 0000000..4199393
--- /dev/null
+++ b/game/fbo.hh
@@ -0,0 +1,46 @@
+#pragma once
+
+#include "video_driver.hh"
+
+/// Frame Buffer Object class
+class FBO {
+ public:
+ /// Generate the FBO and attach a fresh texture to it
+ FBO(): m_texture() {
+ glGenFramebuffersEXT(1, &m_fbo);
+ bind();
+ {
+ UseTexture tex(m_texture);
+ glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA, screenW(), screenH(), 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ // Bind texture as COLOR_ATTACHMENT0
+ glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, m_texture.id(), 0);
+ }
+ unbind();
+ }
+ /// Handle clean-up
+ ~FBO() {
+ if (m_fbo) glDeleteFramebuffersEXT(1, &m_fbo);
+ }
+ /// Returns a reference to the attached texture
+ OpenGLTexture<GL_TEXTURE_RECTANGLE_ARB>& getTexture() {
+ return m_texture;
+ }
+ /// Bind the FBO into use
+ void bind() {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_fbo);
+ }
+ /// Unbind any FBO
+ static void unbind() {
+ glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
+ }
+
+ private:
+ GLuint m_fbo;
+ OpenGLTexture<GL_TEXTURE_RECTANGLE_ARB> m_texture;
+};
+
+/// RAII FBO binder
+struct UseFBO {
+ UseFBO(FBO& fbo) { fbo.bind(); }
+ ~UseFBO() { FBO::unbind(); }
+};
|
|
From: Tapio V. <aa...@us...> - 2010-11-04 22:35:16
|
Module: performous
Branch: opengl2
Commit: 439015947a929fc35b47aa9f5433cd863d3ee2c7
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 5 00:32:00 2010 +0200
Intro screen background now changes its color dynamically through a shader.
Also, UseTexture can now figure out the shader-in-use itself and
it is possible to access the currently active Shader object globally.
---
game/3dobject.hh | 2 +-
game/glshader.cc | 8 +++++++-
game/glshader.hh | 20 +++++++++++++++++++-
game/screen_intro.cc | 8 +++++++-
game/surface.hh | 4 ++--
game/theme.cc | 2 ++
game/theme.hh | 6 ++++++
themes/default/shaders/intro.frag | 28 ++++++++++++++++++++++++++++
themes/default/shaders/intro.vert | 7 +++++++
9 files changed, 79 insertions(+), 6 deletions(-)
diff --git a/game/3dobject.hh b/game/3dobject.hh
index 6a32cb7..834cb28 100644
--- a/game/3dobject.hh
+++ b/game/3dobject.hh
@@ -72,7 +72,7 @@ class Object3d: boost::noncopyable {
if (s != 1.0) glScalef(s,s,s); // Scale if needed
UseShader objectShader(*shader); // Switch shader
if (m_texture) {
- UseTexture tex(*m_texture, *shader);
+ UseTexture tex(*m_texture);
drawVBO();
} else {
drawVBO();
diff --git a/game/glshader.cc b/game/glshader.cc
index b2c6044..3d0f965 100644
--- a/game/glshader.cc
+++ b/game/glshader.cc
@@ -2,6 +2,7 @@
#include "glutil.hh"
#include "video_driver.hh"
#include "3dobject.hh"
+#include "theme.hh"
#include "fs.hh"
#include <fstream>
@@ -42,8 +43,9 @@ namespace {
}
}
+Shader::ShaderMap Shader::shaders;
-Shader::Shader(): program(), vert_shader(), frag_shader() {}
+Shader::Shader(): program(0), vert_shader(), frag_shader() {}
Shader::Shader(const std::string& vert_path, const std::string& frag_path, bool use) {
loadFromFile(vert_path, frag_path, use);
@@ -111,8 +113,11 @@ void Shader::loadFromMemory(const char* vert_source, const char* frag_source, bo
tex = glGetUniformLocation(program, "tex");
texRect = glGetUniformLocation(program, "texRect");
texMode = glGetUniformLocation(program, "texMode");
+ anim = glGetUniformLocation(program, "anim");
glutil::GLErrorChecker uniformerror("Shader::loadFromMemory - glGetUniformLocation");
+ shaders[program] = this;
+
if (use) bind();
}
@@ -127,4 +132,5 @@ void 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")));
+ ThemeIntro::shader.reset(new Shader(getThemePath("shaders/intro.vert"), getThemePath("shaders/intro.frag")));
}
diff --git a/game/glshader.hh b/game/glshader.hh
index 4705117..71c285d 100644
--- a/game/glshader.hh
+++ b/game/glshader.hh
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <map>
#include <GL/glew.h>
#include <boost/noncopyable.hpp>
@@ -19,8 +20,25 @@ struct Shader: public boost::noncopyable {
void bind();
GLuint program, vert_shader, frag_shader; ///< shader object ids
- GLint tex, texRect, texMode; ///< uniform locations
+ // TODO: Should probably use an std::map for these and cache on-the-fly/on-demand.
+ // Also provide a nice access to setting the uniform.
+ GLint tex, texRect, texMode, anim; ///< uniform locations
int gl_response;
+
+ // Some operators
+ operator bool() const { return program != 0; }
+ bool operator==(const Shader& rhs) const { return program == rhs.program; }
+ bool operator!=(const Shader& rhs) const { return program != rhs.program; }
+
+ /** Returns pointer to the currently used shader. */
+ static Shader* current() {
+ GLint i;
+ glGetIntegerv(GL_CURRENT_PROGRAM, &i);
+ return shaders[i];
+ }
+
+ typedef std::map<GLint, Shader*> ShaderMap;
+ static ShaderMap shaders;
};
diff --git a/game/screen_intro.cc b/game/screen_intro.cc
index dd7330d..61e9023 100644
--- a/game/screen_intro.cc
+++ b/game/screen_intro.cc
@@ -6,6 +6,7 @@
#include "joystick.hh"
#include "theme.hh"
#include "menu.hh"
+#include "xtime.hh"
ScreenIntro::ScreenIntro(std::string const& name, Audio& audio): Screen(name), m_audio(audio), m_first(true) {
@@ -112,7 +113,12 @@ void ScreenIntro::draw_menu_options() {
}
void ScreenIntro::draw() {
- theme->bg.draw();
+ {
+ UseShader s(*ThemeIntro::shader);
+ float anim = std::abs((((SDL_GetTicks() % 10000) / 10000.f) - 0.5f) * 2.0f);
+ glUniform1f(ThemeIntro::shader->anim, anim);
+ theme->bg.draw();
+ }
if (m_menu.current().image) m_menu.current().image->draw();
// Comment
theme->comment_bg.dimensions.center().screenBottom(-0.01);
diff --git a/game/surface.hh b/game/surface.hh
index 574a6ae..2a9ef6b 100644
--- a/game/surface.hh
+++ b/game/surface.hh
@@ -120,8 +120,8 @@ template <GLenum Type> class OpenGLTexture: boost::noncopyable {
class UseTexture: boost::noncopyable {
public:
/// constructor
- template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s, Shader& shdr = *Window::shader):
- m_shader(shdr) {
+ template <GLenum Type> UseTexture(OpenGLTexture<Type> const& s):
+ m_shader(*Shader::current()) {
glUniform1i(m_shader.tex, 0);
glUniform1i(m_shader.texRect, 1);
diff --git a/game/theme.cc b/game/theme.cc
index dbaab57..b07051d 100644
--- a/game/theme.cc
+++ b/game/theme.cc
@@ -44,6 +44,8 @@ ThemeAudioDevices::ThemeAudioDevices():
comment_bg(getThemePath("mainmenu_comment_bg.svg"))
{}
+boost::scoped_ptr<Shader> ThemeIntro::shader;
+
ThemeIntro::ThemeIntro():
Theme(getThemePath("intro_bg.svg")),
back_h(getThemePath("mainmenu_back_highlight.svg")),
diff --git a/game/theme.hh b/game/theme.hh
index 8b77f32..ac9bd48 100644
--- a/game/theme.hh
+++ b/game/theme.hh
@@ -4,8 +4,12 @@
#include "surface.hh"
#include "cachemap.hh"
#include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
#include <string>
+
+class Shader;
+
/// abstract theme class
class Theme: boost::noncopyable {
protected:
@@ -90,6 +94,8 @@ public:
Surface comment_bg;
/// configuration comment background (short tip)
Surface short_comment_bg;
+ /// Custom background shader
+ static boost::scoped_ptr<Shader> shader;
};
/// theme for instrument menu
diff --git a/themes/default/shaders/intro.frag b/themes/default/shaders/intro.frag
new file mode 100644
index 0000000..f4665b3
--- /dev/null
+++ b/themes/default/shaders/intro.frag
@@ -0,0 +1,28 @@
+#extension GL_ARB_texture_rectangle : enable
+
+uniform int texMode;
+uniform sampler2D tex;
+uniform sampler2DRect texRect;
+
+uniform float anim;
+
+void main()
+{
+ vec4 texel;
+
+ 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;
+ } else {
+ texel = vec4(1.0, 0.0, 1.0, 1.0); // Magenta to highlight
+ }
+
+ float r = anim * 0.5;
+ float g = anim * 0.5 + 0.5;
+ float b = anim * 0.3 + 0.7;
+
+ gl_FragColor = vec4(texel.r * r, texel.g * g, texel.b * b, texel.a);
+}
diff --git a/themes/default/shaders/intro.vert b/themes/default/shaders/intro.vert
new file mode 100644
index 0000000..570a61a
--- /dev/null
+++ b/themes/default/shaders/intro.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-04 22:35:14
|
Module: performous Branch: opengl2 Commit: 8118555ed310dc72bebfd9f813bd3947efa8c939 Author: Tapio Vierros <tap...@gm...> Date: Thu Nov 4 21:33:57 2010 +0200 Fix glsl compiler warning. --- themes/default/shaders/3dobject.frag | 2 ++ themes/default/shaders/core.frag | 2 ++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag index 28b1867..7a1e127 100644 --- a/themes/default/shaders/3dobject.frag +++ b/themes/default/shaders/3dobject.frag @@ -1,3 +1,5 @@ +#extension GL_ARB_texture_rectangle : enable + uniform int texMode; uniform sampler2D tex; uniform sampler2DRect texRect; diff --git a/themes/default/shaders/core.frag b/themes/default/shaders/core.frag index fcf50ce..8f78c53 100644 --- a/themes/default/shaders/core.frag +++ b/themes/default/shaders/core.frag @@ -1,3 +1,5 @@ +#extension GL_ARB_texture_rectangle : enable + uniform int texMode; uniform sampler2D tex; uniform sampler2DRect texRect; |
|
From: Tapio V. <aa...@us...> - 2010-11-04 17:44:09
|
Module: performous
Branch: opengl2
Commit: 19c12ed06bcec3b5c4d4da053dcbcf43750198ea
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 4 19:42:32 2010 +0200
Fix VBO vertex counts.
---
game/3dobject.cc | 31 +++++++++++++++----------------
1 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index d07fa8e..0b0b1f6 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -6,7 +6,6 @@
#include <cmath>
#include <boost/lexical_cast.hpp>
-
// TODO: test & fix faces that doesn't have texcoords in the file
// TODO: group handling for loader
@@ -98,22 +97,23 @@ void Object3d::drawVBO() {
if (m_vboStructure & HAS_NORMALS) stride += 3*sizeof(GLfloat);
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
-
+
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, stride, (const GLvoid *)offset);
offset += 3*sizeof(GLfloat);
- 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 & HAS_NORMALS) {
glEnableClientState(GL_NORMAL_ARRAY);
glNormalPointer(GL_FLOAT, stride, (const GLvoid *)offset);
+ offset += 3*sizeof(GLfloat);
+ }
+
+ if (m_vboStructure & HAS_TEXCOORDS) {
+ glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+ glTexCoordPointer(2, GL_FLOAT, stride, (const GLvoid *)offset);
}
- glDrawArrays(m_polyType, 0, m_numvertices*stride);
+ glDrawArrays(m_polyType, 0, m_numvertices);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
@@ -129,11 +129,10 @@ void Object3d::generateVBO() {
glGenBuffers(1, &m_vbo);
glBindBuffer(GL_ARRAY_BUFFER, m_vbo);
- m_numvertices = m_vertices.size();
-
// TODO: We should tessellate everything into triangles somehow
// in order to allow non-triangle based meshes.
m_polyType = GL_TRIANGLES;
+ m_numvertices = m_faces.size() * 3; // Triangle faces
m_vboStructure = 0;
if (!m_texcoords.empty()) m_vboStructure |= HAS_TEXCOORDS;
@@ -141,21 +140,21 @@ void Object3d::generateVBO() {
std::vector<Face>::const_iterator i;
for (i = m_faces.begin(); i != m_faces.end(); ++i) {
- for (size_t j = 0; j < i->vertices.size(); j++) {
+ for (size_t j = 0; j < i->vertices.size(); ++j) {
data.push_back(m_vertices[i->vertices[j]].x);
data.push_back(m_vertices[i->vertices[j]].y);
data.push_back(m_vertices[i->vertices[j]].z);
- 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 & 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);
}
+
+ if (m_vboStructure & HAS_TEXCOORDS) {
+ data.push_back(m_texcoords[i->texcoords[j]].s);
+ data.push_back(m_texcoords[i->texcoords[j]].t);
+ }
}
}
|
|
From: Tapio V. <aa...@us...> - 2010-11-04 16:30:37
|
Module: performous
Branch: opengl2
Commit: ab62ee937134d00916a1413226417922caa1015f
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 4 18:29:35 2010 +0200
Shader compatibility hack.
---
themes/default/shaders/3dobject.frag | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/themes/default/shaders/3dobject.frag b/themes/default/shaders/3dobject.frag
index 67c317e..28b1867 100644
--- a/themes/default/shaders/3dobject.frag
+++ b/themes/default/shaders/3dobject.frag
@@ -6,7 +6,7 @@ varying vec3 normal;
void main()
{
- const vec3 lightDir = normalize(vec3(-50.0, 5.0, -15.0));
+ vec3 lightDir = normalize(vec3(-50.0, 5.0, -15.0));
const vec3 ambient = vec3(0.1, 0.1, 0.1);
vec4 texel;
|
|
From: Tapio V. <aa...@us...> - 2010-11-04 16:24:28
|
Module: performous
Branch: opengl2
Commit: 13b09b0095466c46c3f6c0a269a5ff880baca64a
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 4 18:23:42 2010 +0200
Fix dance cursor arrows not showing up on some GPUs.
---
game/dancegraph.cc | 15 +++++++++------
1 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 441726e..833e5a4 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -442,12 +442,15 @@ void DanceGraph::draw(double time) {
drawBeats(time);
// Arrows on cursor
- for (int arrow_i = 0; arrow_i < m_pads; ++arrow_i) {
- float x = panel2x(arrow_i);
- float y = time2y(0.0);
- float l = m_pressed_anim[arrow_i].get();
- float s = getScale() * (5.0 - l) / 5.0;
- drawArrow(arrow_i, m_arrows_cursor, x, y, s);
+ {
+ glutil::Color c(Color(1.0f, 1.0f, 1.0f, 1.0f));
+ for (int arrow_i = 0; arrow_i < m_pads; ++arrow_i) {
+ float x = panel2x(arrow_i);
+ float y = time2y(0.0);
+ float l = m_pressed_anim[arrow_i].get();
+ float s = getScale() * (5.0 - l) / 5.0;
+ drawArrow(arrow_i, m_arrows_cursor, x, y, s);
+ }
}
// Draw the notes
|
|
From: Tapio V. <aa...@us...> - 2010-11-04 12:30:40
|
Module: performous
Branch: opengl2
Commit: e3e7ab307e4584a5c054661127e4cdfcb5f1682d
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 4 14:29:39 2010 +0200
Fix buggy Object3d::generateVBO.
---
game/3dobject.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index e62e499..d07fa8e 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -160,6 +160,7 @@ void Object3d::generateVBO() {
}
glBufferData(GL_ARRAY_BUFFER, sizeof(GLfloat)*data.size(), &data.front(), GL_STATIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, 0);
data.clear();
m_vertices.clear();
m_normals.clear();
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 19:39:09
|
Module: performous
Branch: opengl2
Commit: cc004f293da9f38962e6d4c001396fb9a0755040
Author: Tapio Vierros <tap...@gm...>
Date: Wed Nov 3 21:34:08 2010 +0200
Fix 3d object rendering.
* VBO generation had broken poly type detection.
* In fact this VBO drawing cannot handle variable poly types.
* So now only pure triangle meshes are allowed.
* Also improved the WavefrontObj loader error handling a bit.
---
game/3dobject.cc | 40 ++++++++++++++++++++++------------------
1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/game/3dobject.cc b/game/3dobject.cc
index 8323db1..e62e499 100644
--- a/game/3dobject.cc
+++ b/game/3dobject.cc
@@ -4,6 +4,7 @@
#include <fstream>
#include <stdexcept>
#include <cmath>
+#include <boost/lexical_cast.hpp>
// TODO: test & fix faces that doesn't have texcoords in the file
@@ -28,6 +29,7 @@ boost::scoped_ptr<Shader> Object3d::shader;
/// Load a Wavefront .obj file and possibly scale it also
void Object3d::loadWavefrontObj(std::string filepath, float scale) {
+ int linenumber = 0;
std::string row;
std::ifstream file(filepath.c_str(), std::ios::binary);
if (!file.is_open()) throw std::runtime_error("Couldn't open object file "+filepath);
@@ -37,6 +39,7 @@ void Object3d::loadWavefrontObj(std::string filepath, float scale) {
m_texcoords.clear();
while (!file.eof()) {
getline(file, row); // Read a line
+ ++linenumber;
std::istringstream srow(row);
float x,y,z;
std::string tempst;
@@ -49,37 +52,40 @@ void Object3d::loadWavefrontObj(std::string filepath, float scale) {
} else if (row.substr(0,2) == "vn") { // Normals
srow >> tempst >> x >> y >> z;
double sum = std::abs(x)+std::abs(y)+std::abs(z);
- if (sum == 0) throw std::runtime_error("Object "+filepath+" has invalid normal(s).");
+ if (sum == 0) throw std::runtime_error("Invalid normal in "+filepath+":"+boost::lexical_cast<std::string>(linenumber));
x /= sum; y /= sum; z /= sum; // Normalize components
m_normals.push_back(Vertex(x,y,z));
} else if (row.substr(0,2) == "f ") { // Faces
Face f;
- srow >> tempst;
- int v_id;
+ srow >> tempst; // Eat away prefix
// Parse face point's coordinate references
while (!srow.eof()) {
- srow >> tempst;
- for (size_t i = 1; i <= 3; i++) {
- std::string st_id(getWord(tempst,i,'/'));
+ std::string fpoint;
+ srow >> fpoint;
+ for (size_t i = 1; i <= 3; ++i) {
+ std::string st_id(getWord(fpoint,i,'/'));
if (!st_id.empty()) {
- std::istringstream conv_int(st_id);
- conv_int >> v_id;
+ // Vertex indices are 1-based in the file
+ int v_id = boost::lexical_cast<int>(st_id) - 1;
switch (i) {
- // Vertex indices are 1-based in the file
- case 1: f.vertices.push_back(v_id-1); break;
- case 2: f.texcoords.push_back(v_id-1); break;
- case 3: f.normals.push_back(v_id-1); break;
+ case 1: f.vertices.push_back(v_id); break;
+ case 2: f.texcoords.push_back(v_id); break;
+ case 3: f.normals.push_back(v_id); break;
}
}
}
}
+ // FIXME: We only allow triangle faces since the VBO generator/drawer
+ // cannot handle anything else (at least for now).
+ if (f.vertices.size() > 0 && f.vertices.size() != 3)
+ throw std::runtime_error("Only triangle faces allowed in "+filepath+":"+boost::lexical_cast<std::string>(linenumber));
// Face must have equal number of v, vt, vn or none of a kind
if (f.vertices.size() > 0
&& (f.texcoords.empty() || (f.texcoords.size() == f.vertices.size()))
&& (f.normals.empty() || (f.normals.size() == f.vertices.size()))) {
m_faces.push_back(f);
} else {
- throw std::runtime_error("Object "+filepath+" has invalid face(s).");
+ throw std::runtime_error("Invalid face in "+filepath+":"+boost::lexical_cast<std::string>(linenumber));
}
}
}
@@ -125,11 +131,9 @@ void Object3d::generateVBO() {
m_numvertices = m_vertices.size();
- m_polyType = GL_POLYGON;
- switch (m_vertices.size()) {
- case 3: m_polyType = GL_TRIANGLES; break;
- case 4: m_polyType = GL_QUADS; break;
- }
+ // TODO: We should tessellate everything into triangles somehow
+ // in order to allow non-triangle based meshes.
+ m_polyType = GL_TRIANGLES;
m_vboStructure = 0;
if (!m_texcoords.empty()) m_vboStructure |= HAS_TEXCOORDS;
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 19:09:50
|
Module: web Branch: master Commit: f820f5e37729ce909b6ff7de63793f923526eb68 Author: Tapio Vierros <tap...@gm...> Date: Wed Nov 3 21:09:07 2010 +0200 Add Fedora 14 package links. --- htdocs-source/install.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/htdocs-source/install.txt b/htdocs-source/install.txt index 1d96b64..66554c8 100644 --- a/htdocs-source/install.txt +++ b/htdocs-source/install.txt @@ -27,6 +27,7 @@ If you have problems, please have a look at the <a href="http://wiki.performous. Debian: <a href="apt:performous">performous</a> in official repositories OpenSUSE: <a href="http://packman.links2linux.de/package/Performous/">packages</a> ArchLinux: <a href="http://www.archlinux.org/packages/community/i686/performous/">i686</a> <a href="http://www.archlinux.org/packages/community/x86_64/performous/">x86_64</a> + Fedora 14: <a href="http://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1-Fedora14-i386.rpm/download">i386</a> <a href="http://sourceforge.net/projects/performous/files/performous/0.6.1/Performous-0.6.1-Fedora14-amd64.rpm/download">amd64</a> Mandriva 2010.0: <a href="http://ftp.blogdrake.net/mandriva/2010.0/update/i586/Performous-0.5.1-01bdk2010.0.i586.rpm">i586</a> <a href="http://ftp.blogdrake.net/mandriva/2010.0/update/x86_64/Performous-0.5.1-01bdk2010.0.x86_64.rpm">x86_64</a> If you get an error about unsatisfied dependencies on Ubuntu, you may have to enable the community-supported software source <strong>universe</strong> via <strong>System | Administration | Software Sources</strong>. Most users already have this enabled. |
|
From: Tapio V. <aa...@us...> - 2010-11-03 19:09:47
|
Module: web Branch: master Commit: 9274acbb30ccafea1e160dde0d3d7e58b8e7545f Author: Tapio Vierros <tap...@gm...> Date: Mon Nov 1 20:54:54 2010 +0200 Delete unused deprecated pages from causing confusion. --- htdocs-source/commands.txt | 69 --------------------- htdocs-source/develop.txt | 78 ------------------------ htdocs-source/manual.txt | 143 -------------------------------------------- 3 files changed, 0 insertions(+), 290 deletions(-) |
|
From: Peque <ms...@us...> - 2010-11-03 18:00:47
|
Module: performous
Branch: master
Commit: 80482f9fe5b816a125c083ad1c7e9eb0b6ffa0e5
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Wed Nov 3 18:58:46 2010 +0100
Missing library for supporting MIDI I/O in Fedora packages
---
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 da39d4e..18f65e3 100644
--- a/cmake/performous-packaging.cmake
+++ b/cmake/performous-packaging.cmake
@@ -99,10 +99,10 @@ if(UNIX)
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")
+ 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")
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")
+ 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 "Fedora13")
if(NOT CPACK_RPM_PACKAGE_REQUIRES)
message("WARNING: ${LSB_DISTRIB} is not supported.\nPlease set deps in cmake/performous-packaging.cmake before packaging.")
|
|
From: Tapio V. <aa...@us...> - 2010-11-03 17:12:21
|
Module: performous Branch: opengl2 Commit: 2625900cc668e69f3dfca57fe67324b09b1ce387 Author: Tapio Vierros <tap...@gm...> Date: Wed Nov 3 19:11:01 2010 +0200 Merge branch 'master' into opengl2 --- |
|
From: Tapio V. <aa...@us...> - 2010-11-03 17:12:19
|
Module: performous Branch: opengl2 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-03 17:12:16
|
Module: performous
Branch: opengl2
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-03 17:12:12
|
Module: performous Branch: opengl2 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-11-03 17:12:09
|
Module: performous Branch: opengl2 Commit: 704a0e00c7783a29e9258c417882071286445d75 Author: Tapio Vierros <tap...@gm...> Date: Sun Oct 31 17:49:09 2010 +0200 Bump version to 0.6.1 --- CMakeLists.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc1921d..03f0872 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.0+") +set(PROJECT_VERSION "0.6.1") # Avoid source tree pollution if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |