aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp26
-rw-r--r--engines/sword25/gfx/image/renderedimage.h26
-rw-r--r--engines/sword25/gfx/image/vectorimage.cpp5
3 files changed, 23 insertions, 34 deletions
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index 104e147e43..5ba31c4835 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -38,19 +38,19 @@
#include "sword25/package/packagemanager.h"
#include "sword25/gfx/image/imageloader.h"
-#include "sword25/gfx/image/glimage.h"
+#include "sword25/gfx/image/renderedimage.h"
#include "common/system.h"
namespace Sword25 {
-#define BS_LOG_PREFIX "GLIMAGE"
+#define BS_LOG_PREFIX "RENDEREDIMAGE"
// -----------------------------------------------------------------------------
// CONSTRUCTION / DESTRUCTION
// -----------------------------------------------------------------------------
-GLImage::GLImage(const Common::String &filename, bool &result) :
+RenderedImage::RenderedImage(const Common::String &filename, bool &result) :
_data(0),
_width(0),
_height(0) {
@@ -96,7 +96,7 @@ GLImage::GLImage(const Common::String &filename, bool &result) :
// -----------------------------------------------------------------------------
-GLImage::GLImage(uint width, uint height, bool &result) :
+RenderedImage::RenderedImage(uint width, uint height, bool &result) :
_width(width),
_height(height) {
@@ -111,7 +111,7 @@ GLImage::GLImage(uint width, uint height, bool &result) :
return;
}
-GLImage::GLImage() : _width(0), _height(0), _data(0) {
+RenderedImage::RenderedImage() : _width(0), _height(0), _data(0) {
_backSurface = (static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx")))->getSurface();
_doCleanup = false;
@@ -121,21 +121,21 @@ GLImage::GLImage() : _width(0), _height(0), _data(0) {
// -----------------------------------------------------------------------------
-GLImage::~GLImage() {
+RenderedImage::~RenderedImage() {
if (_doCleanup)
delete[] _data;
}
// -----------------------------------------------------------------------------
-bool GLImage::fill(const Common::Rect *pFillRect, uint color) {
+bool RenderedImage::fill(const Common::Rect *pFillRect, uint color) {
BS_LOG_ERRORLN("Fill() is not supported.");
return false;
}
// -----------------------------------------------------------------------------
-bool GLImage::setContent(const byte *pixeldata, uint size, uint offset, uint stride) {
+bool RenderedImage::setContent(const byte *pixeldata, uint size, uint offset, uint stride) {
// Überprüfen, ob PixelData ausreichend viele Pixel enthält um ein Bild der Größe Width * Height zu erzeugen
if (size < static_cast<uint>(_width * _height * 4)) {
BS_LOG_ERRORLN("PixelData vector is too small to define a 32 bit %dx%d image.", _width, _height);
@@ -154,21 +154,21 @@ bool GLImage::setContent(const byte *pixeldata, uint size, uint offset, uint str
return true;
}
-void GLImage::replaceContent(byte *pixeldata, int width, int height) {
+void RenderedImage::replaceContent(byte *pixeldata, int width, int height) {
_width = width;
_height = height;
_data = pixeldata;
}
// -----------------------------------------------------------------------------
-uint GLImage::getPixel(int x, int y) {
+uint RenderedImage::getPixel(int x, int y) {
BS_LOG_ERRORLN("GetPixel() is not supported. Returning black.");
return 0;
}
// -----------------------------------------------------------------------------
-bool GLImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, uint color, int width, int height) {
+bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, uint color, int width, int height) {
int ca = (color >> 24) & 0xff;
// Check if we need to draw anything at all
@@ -341,7 +341,7 @@ bool GLImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRect, ui
* @param scaleFactor Scale amount. Must be between 0 and 1.0 (but not zero)
* @remarks Caller is responsible for freeing the returned surface
*/
-Graphics::Surface *GLImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) {
+Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) {
Graphics::Surface *s = new Graphics::Surface();
s->create(xSize, ySize, srcImage.bytesPerPixel);
@@ -371,7 +371,7 @@ Graphics::Surface *GLImage::scale(const Graphics::Surface &srcImage, int xSize,
* Returns an array indicating which pixels of a source image horizontally or vertically get
* included in a scaled image
*/
-int *GLImage::scaleLine(int size, int srcSize) {
+int *RenderedImage::scaleLine(int size, int srcSize) {
int scale = 100 * size / srcSize;
assert(scale > 0);
int *v = new int[size];
diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h
index 2b30cec718..a9f2f1823c 100644
--- a/engines/sword25/gfx/image/renderedimage.h
+++ b/engines/sword25/gfx/image/renderedimage.h
@@ -32,8 +32,8 @@
*
*/
-#ifndef SWORD25_GL_IMAGE_H
-#define SWORD25_GL_IMAGE_H
+#ifndef SWORD25_RENDERED_IMAGE_H
+#define SWORD25_RENDERED_IMAGE_H
// -----------------------------------------------------------------------------
// INCLUDES
@@ -45,32 +45,22 @@
namespace Sword25 {
-// -----------------------------------------------------------------------------
-// FORWARD DECLARATION
-// -----------------------------------------------------------------------------
-
-typedef void *GLS_Sprite;
-
-// -----------------------------------------------------------------------------
-// CLASS DEFINITION
-// -----------------------------------------------------------------------------
-
-class GLImage : public Image {
+class RenderedImage : public Image {
public:
- GLImage(const Common::String &filename, bool &result);
+ RenderedImage(const Common::String &filename, bool &result);
/**
- @brief Erzeugt ein leeres BS_GLImage
+ @brief Erzeugt ein leeres BS_RenderedImage
@param Width die Breite des zu erzeugenden Bildes.
@param Height die Höhe des zu erzeugenden Bildes
@param Result gibt dem Aufrufer bekannt, ob der Konstruktor erfolgreich ausgeführt wurde. Wenn es nach dem Aufruf false enthalten sollte,
dürfen keine Methoden am Objekt aufgerufen werden und das Objekt ist sofort zu zerstören.
*/
- GLImage(uint width, uint height, bool &result);
- GLImage();
+ RenderedImage(uint width, uint height, bool &result);
+ RenderedImage();
- virtual ~GLImage();
+ virtual ~RenderedImage();
virtual int getWidth() const {
return _width;
diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp
index 03eea23582..bd67ee793b 100644
--- a/engines/sword25/gfx/image/vectorimage.cpp
+++ b/engines/sword25/gfx/image/vectorimage.cpp
@@ -38,13 +38,12 @@
#include "sword25/kernel/bs_stdint.h"
#include "sword25/gfx/image/vectorimage.h"
+#include "sword25/gfx/image/renderedimage.h"
#include "graphics/colormasks.h"
#include "art.h"
-#include "sword25/gfx/image/glimage.h"
-
namespace Sword25 {
#define BS_LOG_PREFIX "VECTORIMAGE"
@@ -626,7 +625,7 @@ bool VectorImage::blit(int posX, int posY,
oldWidth = width;
}
- GLImage *rend = new GLImage();
+ RenderedImage *rend = new RenderedImage();
rend->replaceContent(_pixelData, width, height);
rend->blit(posX, posY, flipping, pPartRect, color, width, height);