[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kolf-ng
From: Huan Zeng <zh.issac () gmail ! com>
Date: 2009-09-20 9:45:35
Message-ID: 1253439935.634307.32430.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1025966 by hzeng:
deleted the deprecated code.
M +0 -1 CMakeLists.txt
D editor/blender-configwidget.cpp
D editor/blender-configwidget.h
M +1 -41 editor/blender-manager.cpp
M +0 -6 editor/blender-manager.h
M +1 -10 engine/game-editor.cpp
--- trunk/playground/games/kolf-ng/CMakeLists.txt #1025965:1025966
@@ -15,7 +15,6 @@
3d/renderstatemanager.cpp
3d/texturepool.cpp
editor/blender-blendthread.cpp
- editor/blender-configwidget.cpp
editor/blender-delegate.cpp
editor/blender-imageviewer.cpp
editor/blender-itemeditor.cpp
--- trunk/playground/games/kolf-ng/editor/blender-manager.cpp #1025965:1025966
@@ -173,8 +173,7 @@
void Kolf::BlenderManager::blendingFinished()
{
- //changeBrightness() will make the blending result shown on the image viewer.
- changeBrightness(0);
+ m_imageViewer->showImage(m_blendResult);
}
bool Kolf::BlenderManager::setHeightmap()
@@ -196,36 +195,6 @@
return true;
}
-void Kolf::BlenderManager::showHeightmap()
-{
- if(!m_heightmap.isNull())
- m_imageViewer->showImage(m_heightmap);
-}
-
-void Kolf::BlenderManager::changeBrightness(int value)
-{
- QMutexLocker locker(&m_mutex);
- if(!m_isConfigurable || m_blendResult.isNull() )
- return;
- m_isConfigurable = false;
- int width = m_blendResult.width();
- int height = m_blendResult.height();
- m_brightEffect = QImage(width, height, QImage::Format_RGB32);
- int r, g, b;
- for (int x = 0; x < width; ++x)
- for(int y = 0; y < height; ++y)
- {
- QColor color = QColor::fromRgb(m_blendResult.pixel(x, y));
- r = qMin(color.red() + value, 255);
- g = qMin(color.green() + value, 255);
- b = qMin(color.blue() + value, 255);
- color.setRgb(r, g, b);
- m_brightEffect.setPixel(x, y, color.rgb());
- }
- m_imageViewer->showImage(m_brightEffect);
- m_isConfigurable = true;
-}
-
void Kolf::BlenderManager::setOutputWidth(int width)
{
m_outputWidth = width;
@@ -238,13 +207,4 @@
m_imageViewer->setRightText(QString("Output texture\n size: \
(%1,%2)").arg(m_outputWidth).arg(m_outputHeight)); }
-void Kolf::BlenderManager::saveResult()
-{
- if(m_brightEffect.isNull())
- return;
- QString fileName = QFileDialog::getSaveFileName(m_imageViewer, i18n("Save File"), \
"./untitled.png", i18n("Images (*.png *.xpm *.jpg)"));
- if (!fileName.isEmpty())
- m_brightEffect.save(fileName);
-}
-
#include "blender-manager.moc"
--- trunk/playground/games/kolf-ng/editor/blender-manager.h #1025965:1025966
@@ -43,8 +43,6 @@
int outputWidth() const {return m_outputWidth;}
int outputHeight() const {return m_outputHeight;}
QListView* view() const {return m_view;}
- const QImage& blendingResult() const {return m_brightEffect;}
- QImage& blendingResult() {return m_brightEffect;}
void setImageViewer(ImageViewer* imageViewer) {m_imageViewer = imageViewer;}
void setDrawingBoard(DrawingBoard* board) {m_drawingBoard = board;}
QMutex& mutex() {return m_mutex;}
@@ -60,11 +58,8 @@
void startBlending();
void processBlending();
void blendingFinished();
- void showHeightmap();
- void changeBrightness(int value);
void setOutputWidth(int width);
void setOutputHeight(int height);
- void saveResult();
friend class BlendThread;
@@ -76,7 +71,6 @@
ImageViewer* m_imageViewer;
QImage m_blendResult;
- QImage m_brightEffect;
bool m_isConfigurable;
int m_outputWidth;
int m_outputHeight;
--- trunk/playground/games/kolf-ng/engine/game-editor.cpp #1025965:1025966
@@ -20,7 +20,6 @@
#include "component-basicviews.h"
#include "course.h"
#include "player.h"
-#include "../editor/blender-configwidget.h"
#include "../editor/blender-imageviewer.h"
#include "../editor/blender-manager.h"
#include "../editor/blender-texturelistwidget.h"
@@ -68,7 +67,7 @@
addPageWidget(imageViewer);
Kolf::TextureListWidget* textureListWidget = new \
Kolf::TextureListWidget(imageViewer); addDockWidget(textureListWidget);
- addDockWidget(new Kolf::BlenderConfigWidget(textureListWidget->blenderManager()));
+
//Heightmap creator's part
Kolf::DrawingBoard* drawingBoard = new Kolf::DrawingBoard;
addPageWidget(drawingBoard);
@@ -95,14 +94,6 @@
actionCollection()->addAction("blender-delTexture", delTexAction);
connect(delTexAction, SIGNAL(triggered()), textureListWidget->blenderManager(), \
SLOT(delTextures()));
- //Action: texture blender -- save blending result
- KAction* saveAction = new KAction(KIcon("document-save"), i18n("&Save"), \
actionCollection());
- saveAction->setShortcut(i18n("Ctrl+S"));
- saveAction->setStatusTip(i18n("Save texture"));
- saveAction->setToolTip(i18n("Save the result"));
- actionCollection()->addAction("blender-saveResult", saveAction);
- connect(saveAction, SIGNAL(triggered()), textureListWidget->blenderManager(), \
SLOT(saveResult()));
-
}
void Kolf::EditorGameUI::setCleanDispatcher(bool clean)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic