BEAWARE all game functionality is disabled with this commit for a while

* rework client modules
* hide main window when loading
* remake top menu functions
* rework modules autoload
* improve path resolving for otml and lua
* move core_widgets to core_lib
* fix tooltip issues
* split some styles
* add bit32 lua library
* fix assert issues
* fix compilation on linux 32 systems
* rework gcc compile options
* renable and fix some warnings
* remove unused constants
* speedup sprite cache
* move UIGame to lua (not funcional yet)
* fix a lot of issues in x11 window
* fix crash handler
* add some warnings do uiwidget
and much more...
This commit is contained in:
Eduardo Bart
2012-02-20 00:27:08 -02:00
parent 96358b317d
commit e03bf33f58
201 changed files with 1443 additions and 707 deletions

View File

@@ -42,7 +42,7 @@ public:
int getMaxTextureSize();
const Size& getViewportSize() { return m_viewportSize; }
TexturePtr getEmptyTexture() { return m_emptyTexture; }
TexturePtr& getEmptyTexture() { return m_emptyTexture; }
private:
Size m_viewportSize;

View File

@@ -39,12 +39,12 @@ void Painter::init()
m_drawTexturedProgram = PainterShaderProgramPtr(new PainterShaderProgram);
m_drawTexturedProgram->addShaderFromSourceCode(Shader::Vertex, glslMainWithTexCoordsVertexShader + glslPositionOnlyVertexShader);
m_drawTexturedProgram->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader + glslTextureSrcFragmentShader);
assert(m_drawTexturedProgram->link());
m_drawTexturedProgram->link();
m_drawSolidColorProgram = PainterShaderProgramPtr(new PainterShaderProgram);
m_drawSolidColorProgram->addShaderFromSourceCode(Shader::Vertex, glslMainVertexShader + glslPositionOnlyVertexShader);
m_drawSolidColorProgram->addShaderFromSourceCode(Shader::Fragment, glslMainFragmentShader + glslSolidColorFragmentShader);
assert(m_drawSolidColorProgram->link());
m_drawSolidColorProgram->link();
}
void Painter::terminate()

View File

@@ -92,7 +92,7 @@ void PainterShaderProgram::setTexture(const TexturePtr& texture)
void PainterShaderProgram::draw(const CoordsBuffer& coordsBuffer, DrawMode drawMode)
{
assert(bind());
bind();
setUniformValue(TIME_UNIFORM, (float)m_startTimer.timeElapsed());

View File

@@ -20,14 +20,14 @@
* THE SOFTWARE.
*/
static int VERTEX_COORDS_ATTR = 0;
static int TEXTURE_COORDS_ATTR = 1;
const static int VERTEX_COORDS_ATTR = 0;
const static int TEXTURE_COORDS_ATTR = 1;
static int PROJECTION_MATRIX_UNIFORM = 0;
static int TEXTURE_TRANSFORM_MATRIX_UNIFORM = 1;
static int COLOR_UNIFORM = 2;
static int OPACITY_UNIFORM = 3;
static int TEXTURE_UNIFORM = 4;
const static int PROJECTION_MATRIX_UNIFORM = 0;
const static int TEXTURE_TRANSFORM_MATRIX_UNIFORM = 1;
const static int COLOR_UNIFORM = 2;
const static int OPACITY_UNIFORM = 3;
const static int TEXTURE_UNIFORM = 4;
static const std::string glslMainVertexShader = "\n\
highp vec4 calculatePosition();\n\

View File

@@ -73,8 +73,6 @@ void Particle::update(double elapsedTime)
void Particle::updatePosition(double elapsedTime)
{
bool mustRedraw = false;
if(m_ignorePhysicsAfter < 0 || m_elapsedTime < m_ignorePhysicsAfter ) {
// update position
PointF delta = m_velocity * elapsedTime;
@@ -83,7 +81,6 @@ void Particle::updatePosition(double elapsedTime)
PointF position = m_position + delta;
if(m_position != position) {
mustRedraw = true;
m_position += delta;
}
@@ -96,11 +93,8 @@ void Particle::updatePosition(double elapsedTime)
void Particle::updateSize()
{
bool mustRedraw = false;
Size size = m_startSize + (m_finalSize - m_startSize) / m_duration * m_elapsedTime;
if(m_size != size) {
mustRedraw = true;
m_size = size;
}
@@ -109,15 +103,12 @@ void Particle::updateSize()
void Particle::updateColor()
{
bool mustRedraw = false;
if(m_elapsedTime < m_colorsStops[1]) {
Color color = Color(m_colors[0].r() + (m_colors[1].r() - m_colors[0].r()) / (m_colorsStops[1] - m_colorsStops[0]) * (m_elapsedTime - m_colorsStops[0]),
m_colors[0].g() + (m_colors[1].g() - m_colors[0].g()) / (m_colorsStops[1] - m_colorsStops[0]) * (m_elapsedTime - m_colorsStops[0]),
m_colors[0].b() + (m_colors[1].b() - m_colors[0].b()) / (m_colorsStops[1] - m_colorsStops[0]) * (m_elapsedTime - m_colorsStops[0]),
m_colors[0].a() + (m_colors[1].a() - m_colors[0].a()) / (m_colorsStops[1] - m_colorsStops[0]) * (m_elapsedTime - m_colorsStops[0]));
if(m_color != color) {
mustRedraw = true;
m_color = color;
}
}
@@ -128,7 +119,6 @@ void Particle::updateColor()
}
else {
if(m_color != m_colors[0]) {
mustRedraw = true;
m_color = m_colors[0];
}
}

View File

@@ -30,7 +30,6 @@ bool ParticleManager::load(const std::string& filename)
{
try {
OTMLDocumentPtr doc = OTMLDocument::parse(filename);
const OTMLNodePtr& node = doc->at("ParticleSystem");
for(const OTMLNodePtr& node : doc->children()) {
if(node->tag() == "ParticleSystem") {
ParticleSystemPtr particleSystem = ParticleSystemPtr(new ParticleSystem);