aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25/gfx/opengl/glimage.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-13 15:24:23 +0000
committerEugene Sandulenko2010-10-12 22:39:23 +0000
commitfd40021a722956a3c37119c72b1350acb313574e (patch)
treeb61dd65523d8a26a3b39cfa7fa44c36fc81982f8 /engines/sword25/gfx/opengl/glimage.cpp
parentd50dcb80ad44465745a38ea42bd87db9480db949 (diff)
downloadscummvm-rg350-fd40021a722956a3c37119c72b1350acb313574e.tar.gz
scummvm-rg350-fd40021a722956a3c37119c72b1350acb313574e.tar.bz2
scummvm-rg350-fd40021a722956a3c37119c72b1350acb313574e.zip
SWORD25: Started rewriting gfx subsystem
svn-id: r53227
Diffstat (limited to 'engines/sword25/gfx/opengl/glimage.cpp')
-rw-r--r--engines/sword25/gfx/opengl/glimage.cpp29
1 files changed, 3 insertions, 26 deletions
diff --git a/engines/sword25/gfx/opengl/glimage.cpp b/engines/sword25/gfx/opengl/glimage.cpp
index d5e1376299..3ab20016de 100644
--- a/engines/sword25/gfx/opengl/glimage.cpp
+++ b/engines/sword25/gfx/opengl/glimage.cpp
@@ -75,8 +75,7 @@ BS_GLImage::BS_GLImage(const Common::String &Filename, bool &Result) :
}
// Das Bild dekomprimieren
- char *pUncompressedData;
- if (!BS_ImageLoader::LoadImage(pFileData, FileSize, BS_GraphicEngine::CF_ABGR32, pUncompressedData, m_Width, m_Height, Pitch)) {
+ if (!BS_ImageLoader::LoadImage(pFileData, FileSize, BS_GraphicEngine::CF_ABGR32, _data, m_Width, m_Height, Pitch)) {
BS_LOG_ERRORLN("Could not decode image.");
return;
}
@@ -84,19 +83,6 @@ BS_GLImage::BS_GLImage(const Common::String &Filename, bool &Result) :
// Dateidaten freigeben
delete[] pFileData;
- // GLS-Sprite mit den Bilddaten erstellen
- GLS_Result GLSResult = GLS_NewSprite(m_Width, m_Height,
- (ColorFormat == BS_GraphicEngine::CF_ARGB32) ? GLS_True : GLS_False,
- pUncompressedData,
- &m_Sprite);
- if (Result != GLS_OK) {
- BS_LOG_ERRORLN("Could not create GLS_Sprite. Reason: %s", GLS_ResultString(GLSResult));
- return;
- }
-
- // Bilddaten freigeben
- delete[] pUncompressedData;
-
Result = true;
return;
}
@@ -104,20 +90,11 @@ BS_GLImage::BS_GLImage(const Common::String &Filename, bool &Result) :
// -----------------------------------------------------------------------------
BS_GLImage::BS_GLImage(unsigned int Width, unsigned int Height, bool &Result) :
- m_Sprite(0),
m_Width(Width),
m_Height(Height) {
Result = false;
- // GLS-Sprite mit den Bilddaten erstellen
- GLS_Result GLSResult = GLS_NewSprite(m_Width, m_Height,
- GLS_True,
- 0,
- &m_Sprite);
- if (GLSResult != GLS_OK) {
- BS_LOG_ERRORLN("Could not create GLS_Sprite. Reason: %s", GLS_ResultString(GLSResult));
- return;
- }
+ _data = new byte[Width * Height * 4];
Result = true;
return;
@@ -126,7 +103,7 @@ BS_GLImage::BS_GLImage(unsigned int Width, unsigned int Height, bool &Result) :
// -----------------------------------------------------------------------------
BS_GLImage::~BS_GLImage() {
- if (m_Sprite) GLS_DeleteSprite(m_Sprite);
+ delete[] _data;
}
// -----------------------------------------------------------------------------