[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/libs/kgllib
From: Rivo Laks <rivolaks () hot ! ee>
Date: 2009-08-08 13:01:09
Message-ID: 1249736469.051649.5589.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1008817 by rivol:
Fix some Krazy problems.
M +5 -3 core/kgllib/batch.h
M +1 -1 core/kgllib/geometrybuffer.h
M +6 -6 core/kgllib/renderer.cpp
M +7 -7 core/kgllib/textrenderer.cpp
M +3 -3 core/kgllib/textrenderer.h
M +2 -2 examples/earth/earth.h
M +4 -4 examples/spinninglogos/logos.h
M +3 -3 examples/widgets/demoglwidget.cpp
M +2 -2 extras/kgllib/hdrglwidget.cpp
M +1 -1 extras/kgllib/hdrglwidget.h
M +3 -3 extras/kgllib/hdrglwidgetcontrol.h
M +1 -1 extras/kgllib/modelloader.cpp
M +1 -1 extras/kgllib/widgetproxy.h
--- trunk/playground/libs/kgllib/core/kgllib/batch.h #1008816:1008817
@@ -3,7 +3,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -11,7 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -20,7 +20,9 @@
#include "kgllib.h"
#include "geometrybuffer.h"
-#include <QList>
+
+#include <QtCore/QList>
+
#include <Eigen/Core>
--- trunk/playground/libs/kgllib/core/kgllib/geometrybuffer.h #1008816:1008817
@@ -55,7 +55,7 @@
* be used.
**/
GeometryBufferFormat();
- GeometryBufferFormat(int vertexCount, int indexCount = 0);
+ explicit GeometryBufferFormat(int vertexCount, int indexCount = 0);
GeometryBufferFormat(Format fmt, int vertexCount, int indexCount = 0);
/**
--- trunk/playground/libs/kgllib/core/kgllib/renderer.cpp #1008816:1008817
@@ -3,7 +3,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -11,7 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -45,24 +45,24 @@
bool Renderer::bindTexture(const TextureBase* tex)
{
glBindTexture(tex->glTarget(), tex->glId());
- return checkGLError("Renderer::bindTexture(" + tex->debugString() + ")");
+ return checkGLError("Renderer::bindTexture(" + tex->debugString() + ')');
}
bool Renderer::unbindTexture(const TextureBase* tex)
{
glBindTexture(tex->glTarget(), 0);
- return checkGLError("Renderer::unbindTexture(" + tex->debugString() + ")");
+ return checkGLError("Renderer::unbindTexture(" + tex->debugString() + ')');
}
bool Renderer::enableTexture(const TextureBase* tex)
{
glEnable(tex->glTarget());
- return checkGLError("Renderer::enableTexture(" + tex->debugString() + ")");
+ return checkGLError("Renderer::enableTexture(" + tex->debugString() + ')');
}
bool Renderer::disableTexture(const TextureBase* tex)
{
glDisable(tex->glTarget());
- return checkGLError("Renderer::disableTexture(" + tex->debugString() + ")");
+ return checkGLError("Renderer::disableTexture(" + tex->debugString() + ')');
}
bool Renderer::bindProgram(const Program* prog)
--- trunk/playground/libs/kgllib/core/kgllib/textrenderer.cpp #1008816:1008817
@@ -4,7 +4,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -12,7 +12,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -512,7 +512,7 @@
// Split the string into lines
QStringList lines = string.split('\n');
- foreach (QString line, lines) {
+ foreach (const QString& line, lines) {
d->do_draw(line, font);
// Move one line down
glTranslatef(0, -fontMetrics.lineSpacing(), 0);
@@ -538,16 +538,16 @@
if (flags & Qt::TextWordWrap) {
// Wrap the lines if necessary
QStringList newlines;
- foreach (QString line, lines) {
+ foreach (const QString& line, lines) {
QString newline;
int newlinew = 0;
QStringList words = line.simplified().split(' ');
- foreach (QString word, words) {
- int wordw = fontMetrics.width(" " + word);
+ foreach (const QString& word, words) {
+ int wordw = fontMetrics.width(' ' + word);
if (newlinew + wordw > rect.width()) {
// Break the line here
newlines.append(newline);
- newline = QString();
+ newline.clear();
newlinew = 0;
}
if (!newline.isEmpty()) {
--- trunk/playground/libs/kgllib/core/kgllib/textrenderer.h #1008816:1008817
@@ -4,7 +4,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -12,7 +12,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -133,7 +133,7 @@
/**
* Draws 2D text within the given rectangle.
- * The text will be positioned and layed out according to @p flags which
+ * The text will be positioned and laid out according to @p flags which
* is a bitwise OR of the following flags:
* @li Qt::AlignLeft
* @li Qt::AlignRight
--- trunk/playground/libs/kgllib/examples/earth/earth.h #1008816:1008817
@@ -15,8 +15,8 @@
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef COVERBLING_H
-#define COVERBLING_H
+#ifndef EARTH_H
+#define EARTH_H
#include <kgllib/glwidget.h>
#include <kgllib/trackball.h>
--- trunk/playground/libs/kgllib/examples/spinninglogos/logos.h #1008816:1008817
@@ -3,7 +3,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -11,12 +11,12 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef COVERBLING_H
-#define COVERBLING_H
+#ifndef LOGOS_H
+#define LOGOS_H
#include <kgllib/glwidget.h>
--- trunk/playground/libs/kgllib/examples/widgets/demoglwidget.cpp #1008816:1008817
@@ -3,7 +3,7 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
+ * License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@@ -11,7 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Lesser General Public
+ * You should have received a copy of the GNU Lesser General Public
* License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -87,7 +87,7 @@
glColor3f(1.0, 1.0, 0.0);
glLineWidth(2.0);
glBegin(GL_LINES);
- foreach (QLine line, mLines) {
+ foreach (const QLine& line, mLines) {
glVertex2i(line.x1(), line.y1());
glVertex2i(line.x2(), line.y2());
}
--- trunk/playground/libs/kgllib/extras/kgllib/hdrglwidget.cpp #1008816:1008817
@@ -68,7 +68,7 @@
mTonemappingProgram = 0;
mHdrRenderingSupported = false;
- mDataPath = ".";
+ mDataPath = '.';
mHdrRenderingActive = true;
mExposure = 1.0f;
@@ -139,7 +139,7 @@
glClampColorARB(GL_CLAMP_READ_COLOR_ARB, GL_FALSE);
}
- // Load datas
+ // Load data
// Tonemapping program
mTonemappingProgram = new Program(mDataPath + "/tonemapping.vert", mDataPath + "/tonemapping.frag");
if (!mTonemappingProgram->isValid()) {
--- trunk/playground/libs/kgllib/extras/kgllib/hdrglwidget.h #1008816:1008817
@@ -84,7 +84,7 @@
**/
void setDataPath(const QString& path);
-public slots:
+public Q_SLOTS:
/**
* Activates or deactivates HDR rendering. Note that if HDR rendering
* isn't supported on current hardware then it has no effect and HDR
--- trunk/playground/libs/kgllib/extras/kgllib/hdrglwidgetcontrol.h #1008816:1008817
@@ -31,13 +31,13 @@
{
Q_OBJECT
public:
- HdrGLWidgetControl(HdrGLWidget* widget, QWidget* parent = 0);
+ explicit HdrGLWidgetControl(HdrGLWidget* widget, QWidget* parent = 0);
virtual ~HdrGLWidgetControl();
-public slots:
+public Q_SLOTS:
void updateSettings();
-protected slots:
+protected Q_SLOTS:
void setBloomDownsize(int ds);
void setBloomStrength(double s);
void setExposure(double exp);
--- trunk/playground/libs/kgllib/extras/kgllib/modelloader.cpp #1008816:1008817
@@ -216,7 +216,7 @@
QByteArray line = f.readLine();
if (line.endsWith("\r\n")) {
line.truncate(line.length() - 2);
- } else if (line.endsWith("\n")) {
+ } else if (line.endsWith('\n')) {
line.truncate(line.length() - 1);
}
QList<QByteArray> tokens = line.split(' ');
--- trunk/playground/libs/kgllib/extras/kgllib/widgetproxy.h #1008816:1008817
@@ -41,7 +41,7 @@
class KGLLIB_EXTRAS_EXPORT WidgetProxy : public QGraphicsView
{
public:
- WidgetProxy(GLWidget* w, QWidget* parent = 0);
+ explicit WidgetProxy(GLWidget* w, QWidget* parent = 0);
QGraphicsProxyWidget* addWidget(QWidget* w);
QWidget* createWindow(const QString& title);
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic