aboutsummaryrefslogtreecommitdiff
path: root/saga
diff options
context:
space:
mode:
authorEugene Sandulenko2004-07-31 13:49:26 +0000
committerEugene Sandulenko2004-07-31 13:49:26 +0000
commit6e6edb8c0d13f24f14c315bae25088a6b2226c7a (patch)
tree93c0f2f3eccd0a711d76b9f90fbb32b0b7bb61f9 /saga
parent6038cf68ada2495c7335a771df4ad0e9652a877b (diff)
downloadscummvm-rg350-6e6edb8c0d13f24f14c315bae25088a6b2226c7a.tar.gz
scummvm-rg350-6e6edb8c0d13f24f14c315bae25088a6b2226c7a.tar.bz2
scummvm-rg350-6e6edb8c0d13f24f14c315bae25088a6b2226c7a.zip
Objectize image.cpp
svn-id: r14391
Diffstat (limited to 'saga')
-rw-r--r--saga/image.cpp13
-rw-r--r--saga/image.h4
-rw-r--r--saga/image_mod.h37
-rw-r--r--saga/interface.cpp5
-rw-r--r--saga/saga.h10
-rw-r--r--saga/scene.cpp7
6 files changed, 21 insertions, 55 deletions
diff --git a/saga/image.cpp b/saga/image.cpp
index d63f9fc260..edff30be08 100644
--- a/saga/image.cpp
+++ b/saga/image.cpp
@@ -27,7 +27,6 @@
#include "game_mod.h"
-#include "image_mod.h"
#include "image.h"
namespace Saga {
@@ -50,8 +49,8 @@ static int granulate(int value, int granularity) {
}
}
-int IMG_DecodeBGImage(const byte * image_data, size_t image_size,
- byte ** output_buf, size_t * output_buf_len, int *w, int *h) {
+int SagaEngine::decodeBGImage(const byte *image_data, size_t image_size,
+ byte **output_buf, size_t *output_buf_len, int *w, int *h) {
R_IMAGE_HEADER hdr;
int modex_height;
const byte *RLE_data_ptr;
@@ -109,7 +108,7 @@ int IMG_DecodeBGImage(const byte * image_data, size_t image_size,
return R_SUCCESS;
}
-int DecodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len) {
+int SagaEngine::DecodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len) {
const byte *inbuf_ptr;
byte *outbuf_ptr;
uint32 inbuf_remain;
@@ -303,7 +302,7 @@ int DecodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t o
return R_SUCCESS;
}
-int FlipImage(byte *img_buf, int columns, int scanlines) {
+int SagaEngine::FlipImage(byte *img_buf, int columns, int scanlines) {
int line;
byte *tmp_scan;
@@ -333,7 +332,7 @@ int FlipImage(byte *img_buf, int columns, int scanlines) {
return R_SUCCESS;
}
-int UnbankBGImage(byte *dst_buf, const byte *src_buf, int columns, int scanlines) {
+int SagaEngine::UnbankBGImage(byte *dst_buf, const byte *src_buf, int columns, int scanlines) {
int x, y;
int temp;
int quadruple_rows;
@@ -431,7 +430,7 @@ int UnbankBGImage(byte *dst_buf, const byte *src_buf, int columns, int scanlines
return R_SUCCESS;
}
-const byte *IMG_GetImagePal(const byte *image_data, size_t image_size) {
+const byte *SagaEngine::getImagePal(const byte *image_data, size_t image_size) {
if (image_size <= SAGA_IMAGE_HEADER_LEN) {
return NULL;
}
diff --git a/saga/image.h b/saga/image.h
index c96cd56ce3..6f0813d5dd 100644
--- a/saga/image.h
+++ b/saga/image.h
@@ -41,10 +41,6 @@ struct R_IMAGE_HEADER {
int unknown6;
};
-int DecodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len);
-int FlipImage(byte *img_buf, int columns, int scanlines);
-int UnbankBGImage(byte * dest_buf, const byte * src_buf, int columns, int scanlines);
-
} // End of namespace Saga
#endif
diff --git a/saga/image_mod.h b/saga/image_mod.h
deleted file mode 100644
index ca0ec26f57..0000000000
--- a/saga/image_mod.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* ScummVM - Scumm Interpreter
- * Copyright (C) 2004 The ScummVM project
- *
- * The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * $Header$
- *
- */
-
-// SAGA Image resource management routines
-
-#ifndef SAGA_IMAGE_MOD_H_
-#define SAGA_IMAGE_MOD_H_
-
-namespace Saga {
-
-int IMG_DecodeBGImage(const byte *image_data, size_t image_size,
- byte **output_buf, size_t *output_buf_len, int *w, int *h);
-const byte *IMG_GetImagePal(const byte *image_data, size_t image_size);
-
-} // End of namespace Saga
-
-#endif
diff --git a/saga/interface.cpp b/saga/interface.cpp
index c32afc5bf5..3703823cc3 100644
--- a/saga/interface.cpp
+++ b/saga/interface.cpp
@@ -31,7 +31,6 @@
#include "console_mod.h"
#include "font_mod.h"
#include "gfx_mod.h"
-#include "image_mod.h"
#include "objectmap_mod.h"
#include "rscfile_mod.h"
#include "script_mod.h"
@@ -196,10 +195,10 @@ int INTERFACE_Init(void) {
SPRITE_LoadList(ITE_DEFAULT_PORTRAITS, &IfModule.def_portraits);
- IMG_DecodeBGImage(IfModule.c_panel.res, IfModule.c_panel.res_len, &IfModule.c_panel.img,
+ _vm->decodeBGImage(IfModule.c_panel.res, IfModule.c_panel.res_len, &IfModule.c_panel.img,
&IfModule.c_panel.img_len, &IfModule.c_panel.img_w, &IfModule.c_panel.img_h);
- IMG_DecodeBGImage(IfModule.d_panel.res, IfModule.d_panel.res_len,
+ _vm->decodeBGImage(IfModule.d_panel.res, IfModule.d_panel.res_len,
&IfModule.d_panel.img, &IfModule.d_panel.img_len,
&IfModule.d_panel.img_w, &IfModule.d_panel.img_h);
diff --git a/saga/saga.h b/saga/saga.h
index 57cafef9d4..43794e19cd 100644
--- a/saga/saga.h
+++ b/saga/saga.h
@@ -69,6 +69,16 @@ public:
Sound *_sound;
Music *_music;
Anim *_anim;
+
+private:
+ int DecodeBGImageRLE(const byte *inbuf, size_t inbuf_len, byte *outbuf, size_t outbuf_len);
+ int FlipImage(byte *img_buf, int columns, int scanlines);
+ int UnbankBGImage(byte *dest_buf, const byte *src_buf, int columns, int scanlines);
+
+public:
+ int decodeBGImage(const byte *image_data, size_t image_size,
+ byte **output_buf, size_t *output_buf_len, int *w, int *h);
+ const byte *getImagePal(const byte *image_data, size_t image_size);
};
// FIXME: Global var. We use it until everything will be turned into objects
diff --git a/saga/scene.cpp b/saga/scene.cpp
index d0285e5c0f..a5489dd3fa 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -34,7 +34,6 @@
#include "events_mod.h"
#include "actionmap_mod.h"
#include "gfx_mod.h"
-#include "image_mod.h"
#include "isomap_mod.h"
#include "script_mod.h"
#include "objectmap_mod.h"
@@ -584,7 +583,7 @@ int ProcessSceneResources() {
SceneModule.bg.res_len = SceneModule.reslist[i].res_data_len;
SceneModule.bg.loaded = 1;
- if (IMG_DecodeBGImage(SceneModule.bg.res_buf,
+ if (_vm->decodeBGImage(SceneModule.bg.res_buf,
SceneModule.bg.res_len,
&SceneModule.bg.buf,
&SceneModule.bg.buf_len,
@@ -594,7 +593,7 @@ int ProcessSceneResources() {
return R_FAILURE;
}
- pal_p = IMG_GetImagePal(SceneModule.bg.res_buf, SceneModule.bg.res_len);
+ pal_p = _vm->getImagePal(SceneModule.bg.res_buf, SceneModule.bg.res_len);
memcpy(SceneModule.bg.pal, pal_p, sizeof SceneModule.bg.pal);
SceneModule.scene_mode = R_SCENE_MODE_NORMAL;
break;
@@ -606,7 +605,7 @@ int ProcessSceneResources() {
SceneModule.bg_mask.res_buf = SceneModule.reslist[i].res_data;
SceneModule.bg_mask.res_len = SceneModule.reslist[i].res_data_len;
SceneModule.bg_mask.loaded = 1;
- IMG_DecodeBGImage(SceneModule.bg_mask.res_buf, SceneModule.bg_mask.res_len, &SceneModule.bg_mask.buf,
+ _vm->decodeBGImage(SceneModule.bg_mask.res_buf, SceneModule.bg_mask.res_len, &SceneModule.bg_mask.buf,
&SceneModule.bg_mask.buf_len, &SceneModule.bg_mask.w, &SceneModule.bg_mask.h);
break;
case SAGA_OBJECT_NAME_LIST: