[Scummvm-cvs-logs] CVS: scummvm/saga image.cpp,1.9,1.10 image.h,1.4,1.5 interface.cpp,1.9,1.10 saga.h,1.14,1.15 scene.cpp,1.11,1.12 image_mod.h,1.3,NONE

Eugene Sandulenko sev at users.sourceforge.net
Sat Jul 31 06:50:01 CEST 2004


Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25139

Modified Files:
	image.cpp image.h interface.cpp saga.h scene.cpp 
Removed Files:
	image_mod.h 
Log Message:
Objectize image.cpp


Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/image.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- image.cpp	31 Jul 2004 12:37:36 -0000	1.9
+++ image.cpp	31 Jul 2004 13:49:26 -0000	1.10
@@ -27,7 +27,6 @@
 
 #include "game_mod.h"
 
-#include "image_mod.h"
 #include "image.h"
 
 namespace Saga {
@@ -50,8 +49,8 @@
 	}
 }
 
-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 @@
 	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 @@
 	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 @@
 	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 @@
 	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;
 	}

Index: image.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/image.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- image.h	1 May 2004 09:19:35 -0000	1.4
+++ image.h	31 Jul 2004 13:49:26 -0000	1.5
@@ -41,10 +41,6 @@
 	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

Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- interface.cpp	31 Jul 2004 12:37:36 -0000	1.9
+++ interface.cpp	31 Jul 2004 13:49:26 -0000	1.10
@@ -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 @@
 
 	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);
 

Index: saga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/saga.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- saga.h	31 Jul 2004 13:34:43 -0000	1.14
+++ saga.h	31 Jul 2004 13:49:26 -0000	1.15
@@ -69,6 +69,16 @@
 	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

Index: scene.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/scene.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- scene.cpp	31 Jul 2004 13:34:43 -0000	1.11
+++ scene.cpp	31 Jul 2004 13:49:26 -0000	1.12
@@ -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 @@
 			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 @@
 				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 @@
 			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:

--- image_mod.h DELETED ---





More information about the Scummvm-git-logs mailing list