aboutsummaryrefslogtreecommitdiff
path: root/saga/image.cpp
diff options
context:
space:
mode:
authorMax Horn2004-04-27 11:44:17 +0000
committerMax Horn2004-04-27 11:44:17 +0000
commit38ef0d081b70bb84db04099ea32d08616a751814 (patch)
tree1e27915b523199c13a357002f7dca8fb242bd30d /saga/image.cpp
parent1e293d409d2691e9a0698aee43176bd8b72323be (diff)
downloadscummvm-rg350-38ef0d081b70bb84db04099ea32d08616a751814.tar.gz
scummvm-rg350-38ef0d081b70bb84db04099ea32d08616a751814.tar.bz2
scummvm-rg350-38ef0d081b70bb84db04099ea32d08616a751814.zip
Remove yet another file
svn-id: r13654
Diffstat (limited to 'saga/image.cpp')
-rw-r--r--saga/image.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/saga/image.cpp b/saga/image.cpp
index d63e6c1088..cb8ccc2545 100644
--- a/saga/image.cpp
+++ b/saga/image.cpp
@@ -45,6 +45,27 @@
namespace Saga {
+static int granulate(int value, int granularity)
+{
+
+ int remainder;
+
+ if (value == 0)
+ return 0;
+
+ if (granularity == 0)
+ return 0;
+
+ remainder = value % granularity;
+
+ if (remainder == 0) {
+ return value;
+ } else {
+ return (granularity - remainder + value);
+ }
+
+}
+
int
IMG_DecodeBGImage(const uchar * image_data,
size_t image_size,
@@ -78,7 +99,7 @@ IMG_DecodeBGImage(const uchar * image_data,
RLE_data_ptr = image_data + SAGA_IMAGE_DATA_OFFSET;
RLE_data_len = image_size - SAGA_IMAGE_DATA_OFFSET;
- modex_height = Granulate(hdr.height, 4);
+ modex_height = granulate(hdr.height, 4);
decode_buf_len = hdr.width * modex_height;
decode_buf = (uchar *)malloc(decode_buf_len);