aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/gfx
diff options
context:
space:
mode:
authorMax Horn2009-05-12 23:30:10 +0000
committerMax Horn2009-05-12 23:30:10 +0000
commit0255cd0213a219fba69860200a987a0d837493a0 (patch)
tree1dd1ce850fc46e468e1d00a0ed86f5686630b7be /engines/sci/gfx
parent8d8e9d3aaa717616c001083913d0c1e6fff2c580 (diff)
downloadscummvm-rg350-0255cd0213a219fba69860200a987a0d837493a0.tar.gz
scummvm-rg350-0255cd0213a219fba69860200a987a0d837493a0.tar.bz2
scummvm-rg350-0255cd0213a219fba69860200a987a0d837493a0.zip
SCI: Removed sci_memory.h/.cpp
svn-id: r40514
Diffstat (limited to 'engines/sci/gfx')
-rw-r--r--engines/sci/gfx/gfx_gui.cpp2
-rw-r--r--engines/sci/gfx/gfx_pixmap_scale.cpp10
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp10
-rw-r--r--engines/sci/gfx/gfx_system.h1
-rw-r--r--engines/sci/gfx/gfx_test.cpp20
-rw-r--r--engines/sci/gfx/gfx_tools.cpp15
-rw-r--r--engines/sci/gfx/gfx_widgets.cpp3
-rw-r--r--engines/sci/gfx/menubar.cpp3
-rw-r--r--engines/sci/gfx/operations.cpp1
-rw-r--r--engines/sci/gfx/res_font.cpp7
-rw-r--r--engines/sci/gfx/res_pal.cpp1
-rw-r--r--engines/sci/gfx/res_pic.cpp7
-rw-r--r--engines/sci/gfx/res_view0.cpp7
-rw-r--r--engines/sci/gfx/res_view1.cpp11
14 files changed, 42 insertions, 56 deletions
diff --git a/engines/sci/gfx/gfx_gui.cpp b/engines/sci/gfx/gfx_gui.cpp
index e76d8feb12..70ff0faf7d 100644
--- a/engines/sci/gfx/gfx_gui.cpp
+++ b/engines/sci/gfx/gfx_gui.cpp
@@ -366,7 +366,7 @@ GfxList *sciw_new_edit_control(GfxPort *port, reg_t ID, rect_t zone, char *text,
list->add(GFXWC(list), text_handle);
} else {
- char *textdup = (char *)sci_malloc(strlen(text) + 1);
+ char *textdup = (char *)malloc(strlen(text) + 1);
strncpy(textdup, text, cursor);
diff --git a/engines/sci/gfx/gfx_pixmap_scale.cpp b/engines/sci/gfx/gfx_pixmap_scale.cpp
index 9173db5e7c..d13c0d143e 100644
--- a/engines/sci/gfx/gfx_pixmap_scale.cpp
+++ b/engines/sci/gfx/gfx_pixmap_scale.cpp
@@ -65,7 +65,7 @@ void _gfx_xlate_pixmap_unfiltered(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale
assert(bytespp == COPY_BYTES);
if (separate_alpha_map && !alpha_dest)
- alpha_dest = pxm->alpha_map = (byte *)sci_malloc(pxm->index_width * xfact * pxm->index_height * yfact);
+ alpha_dest = pxm->alpha_map = (byte *)malloc(pxm->index_width * xfact * pxm->index_height * yfact);
// Calculate all colors
for (i = 0; i < pxm->colors_nr(); i++) {
@@ -227,7 +227,7 @@ void _gfx_xlate_pixmap_linear(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
shifts[3] = mode->alpha_shift;
if (separate_alpha_map && !alpha_dest)
- alpha_dest = pxm->alpha_map = (byte *)sci_malloc(pxm->index_width * xfact * pxm->index_height * yfact);
+ alpha_dest = pxm->alpha_map = (byte *)malloc(pxm->index_width * xfact * pxm->index_height * yfact);
for (y = 0; y < pxm->index_height; y++) {
byte *linepos = dest;
@@ -380,7 +380,7 @@ void _gfx_xlate_pixmap_trilinear(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale)
return;
if (separate_alpha_map && !alpha_dest)
- alpha_dest = pxm->alpha_map = (byte *)sci_malloc(pxm->index_width * xfact * pxm->index_height * yfact);
+ alpha_dest = pxm->alpha_map = (byte *)malloc(pxm->index_width * xfact * pxm->index_height * yfact);
src -= pxm->index_width + 1;
@@ -614,13 +614,13 @@ void gfx_xlate_pixmap(gfx_pixmap_t *pxm, gfx_mode_t *mode, gfx_xlate_filter_t fi
if (!pxm->data) {
- pxm->data = (byte*)sci_malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height * mode->bytespp + 1);
+ pxm->data = (byte*)malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height * mode->bytespp + 1);
// +1: Eases coying on BE machines in 24 bpp packed mode
// Assume that memory, if allocated already, will be sufficient
// Allocate alpha map
if (!mode->alpha_mask && pxm->colors_nr() < GFX_PIC_COLORS)
- pxm->alpha_map = (byte*)sci_malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height + 1);
+ pxm->alpha_map = (byte*)malloc(mode->xfact * mode->yfact * pxm->index_width * pxm->index_height + 1);
} else
was_allocated = 1;
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index 6866f32be6..35b71236b9 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -118,7 +118,7 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
gfxr_remove_artifacts_pic0(scaled_pic, unscaled_pic);
if (!scaled_pic->undithered_buffer)
- scaled_pic->undithered_buffer = sci_malloc(scaled_pic->undithered_buffer_size);
+ scaled_pic->undithered_buffer = malloc(scaled_pic->undithered_buffer_size);
memcpy(scaled_pic->undithered_buffer, scaled_pic->visual_map->index_data, scaled_pic->undithered_buffer_size);
@@ -359,7 +359,7 @@ gfxr_pic_t *GfxResManager::getPic(int num, int maps, int flags, int default_pale
return NULL;
}
if (!res) {
- res = (gfx_resource_t *)sci_malloc(sizeof(gfx_resource_t));
+ res = (gfx_resource_t *)malloc(sizeof(gfx_resource_t));
res->ID = GFXR_RES_ID(GFX_RESOURCE_TYPE_PIC, num);
#ifdef CUSTOM_GRAPHICS_OPTIONS
res->lock_sequence_nr = _options->buffer_pics_nr;
@@ -548,7 +548,7 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
}
if (!res) {
- res = (gfx_resource_t *)sci_malloc(sizeof(gfx_resource_t));
+ res = (gfx_resource_t *)malloc(sizeof(gfx_resource_t));
res->scaled_data.view = NULL;
res->ID = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
res->lock_sequence_nr = _tagLockCounter;
@@ -619,7 +619,7 @@ gfx_bitmap_font_t *GfxResManager::getFont(int num, bool scaled) {
gfx_bitmap_font_t *font = gfxr_read_font(fontRes->id, fontRes->data, fontRes->size);
if (!res) {
- res = (gfx_resource_t *)sci_malloc(sizeof(gfx_resource_t));
+ res = (gfx_resource_t *)malloc(sizeof(gfx_resource_t));
res->scaled_data.font = NULL;
res->ID = GFXR_RES_ID(GFX_RESOURCE_TYPE_FONT, num);
res->lock_sequence_nr = _tagLockCounter;
@@ -665,7 +665,7 @@ gfx_pixmap_t *GfxResManager::getCursor(int num) {
return NULL;
if (!res) {
- res = (gfx_resource_t *)sci_malloc(sizeof(gfx_resource_t));
+ res = (gfx_resource_t *)malloc(sizeof(gfx_resource_t));
res->scaled_data.pointer = NULL;
res->ID = GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, num);
res->lock_sequence_nr = _tagLockCounter;
diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h
index a698c77f22..beb23b5db1 100644
--- a/engines/sci/gfx/gfx_system.h
+++ b/engines/sci/gfx/gfx_system.h
@@ -28,7 +28,6 @@
#include "common/scummsys.h"
#include "common/rect.h"
-#include "sci/sci_memory.h"
#include "sci/tools.h"
#include "sci/gfx/palette.h"
diff --git a/engines/sci/gfx/gfx_test.cpp b/engines/sci/gfx/gfx_test.cpp
index a3c24159e7..a5f57df315 100644
--- a/engines/sci/gfx/gfx_test.cpp
+++ b/engines/sci/gfx/gfx_test.cpp
@@ -70,10 +70,6 @@ void *memdup(void *mem, size_t size) {
return r;
}
-#ifdef FREESCI_PRIMARY_RESOURCE_H_
-# include "../scicore/sci_memory.c"
-#endif
-
void sci_gettime(long *seconds, long *useconds) {
struct timeval tv;
@@ -178,7 +174,7 @@ int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version, gfx_opt
int *arrdup(int *src, int count) {
- int *retval = sci_malloc(sizeof(int) * count);
+ int *retval = malloc(sizeof(int) * count);
memcpy(retval, src, sizeof(int) * count);
return retval;
}
@@ -221,7 +217,7 @@ gfx_pixmap_color_t pic_colors[PIC_COLORS_NR] = {
};
gfxr_pic_t *gfxr_interpreter_init_pic(int version, gfx_mode_t *mode, int ID, void *internal) {
- gfxr_pic_t *pic = sci_malloc(sizeof(gfxr_pic_t));
+ gfxr_pic_t *pic = malloc(sizeof(gfxr_pic_t));
pic->mode = mode;
pic->undithered_buffer = NULL;
@@ -338,7 +334,7 @@ gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, void *inte
if (nr < 0 || nr > TEST_VIEWS_NR)
return NULL;
- view = sci_malloc(sizeof(gfxr_view_t));
+ view = malloc(sizeof(gfxr_view_t));
view->ID = nr | 2048;
view->flags = GFX_PIXMAP_FLAG_EXTERNAL_PALETTE;
@@ -346,10 +342,10 @@ gfxr_view_t *gfxr_interpreter_get_view(gfx_resstate_t *state, int nr, void *inte
view->colors = view_colors;
view->loops_nr = 1;
- view->loops = loop = sci_malloc(sizeof(gfxr_loop_t));
+ view->loops = loop = malloc(sizeof(gfxr_loop_t));
loop->cels_nr = 3;
- loop->cels = sci_malloc(sizeof(gfx_pixmap_t *) * loop->cels_nr);
+ loop->cels = malloc(sizeof(gfx_pixmap_t *) * loop->cels_nr);
for (i = 0; i < 3; i++) {
gfx_pixmap_t *pxm = gfx_pixmap_alloc_index_data(gfx_new_pixmap(16, 16, 2048 | nr, 0, i));
@@ -402,10 +398,10 @@ gfx_bitmap_font_t *gfxr_interpreter_get_font(gfx_resstate_t *state, int nr, void
if (nr < 0 || nr > TEST_FONTS_NR)
return NULL;
- font = sci_malloc(sizeof(gfx_bitmap_font_t));
+ font = malloc(sizeof(gfx_bitmap_font_t));
font->ID = nr;
font->chars_nr = BUILTIN_CHARS_NR;
- font->widths = sci_malloc(sizeof(int) * BUILTIN_CHARS_NR);
+ font->widths = malloc(sizeof(int) * BUILTIN_CHARS_NR);
for (i = 0; i < BUILTIN_CHARS_NR; i++)
font->widths[i] = BUILTIN_CHARS_WIDTH;
font->row_size = (BUILTIN_CHARS_WIDTH + 7) >> 3;
@@ -1060,7 +1056,7 @@ int main(int argc, char **argv) {
case 'g':
if (driver) sci_free(driver);
- driver = sci_strdup(optarg);
+ driver = strdup(optarg);
break;
case 'l': {
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index 4ac71c0459..ac6e3c022a 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_tools.h"
namespace Sci {
@@ -45,7 +44,7 @@ void gfx_clip_box_basic(rect_t *box, int maxx, int maxy) {
}
gfx_mode_t *gfx_new_mode(int xfact, int yfact, const Graphics::PixelFormat &format, Palette *palette, int flags) {
- gfx_mode_t *mode = (gfx_mode_t *)sci_malloc(sizeof(gfx_mode_t));
+ gfx_mode_t *mode = (gfx_mode_t *)malloc(sizeof(gfx_mode_t));
mode->xfact = xfact;
mode->yfact = yfact;
@@ -108,7 +107,7 @@ void gfx_copy_pixmap_box_i(gfx_pixmap_t *dest, gfx_pixmap_t *src, rect_t box) {
}
gfx_pixmap_t *gfx_clone_pixmap(gfx_pixmap_t *pxm, gfx_mode_t *mode) {
- gfx_pixmap_t *clone = (gfx_pixmap_t *)sci_malloc(sizeof(gfx_pixmap_t));
+ gfx_pixmap_t *clone = (gfx_pixmap_t *)malloc(sizeof(gfx_pixmap_t));
*clone = *pxm;
clone->index_data = NULL;
clone->palette = NULL;
@@ -117,7 +116,7 @@ gfx_pixmap_t *gfx_clone_pixmap(gfx_pixmap_t *pxm, gfx_mode_t *mode) {
memcpy(clone->data, pxm->data, clone->data_size);
if (clone->alpha_map) {
- clone->alpha_map = (byte *) sci_malloc(clone->width * clone->height);
+ clone->alpha_map = (byte *) malloc(clone->width * clone->height);
memcpy(clone->alpha_map, pxm->alpha_map, clone->width * clone->height);
}
@@ -125,7 +124,7 @@ gfx_pixmap_t *gfx_clone_pixmap(gfx_pixmap_t *pxm, gfx_mode_t *mode) {
}
gfx_pixmap_t *gfx_new_pixmap(int xl, int yl, int resid, int loop, int cel) {
- gfx_pixmap_t *pxm = (gfx_pixmap_t *)sci_malloc(sizeof(gfx_pixmap_t));
+ gfx_pixmap_t *pxm = (gfx_pixmap_t *)malloc(sizeof(gfx_pixmap_t));
pxm->alpha_map = NULL;
pxm->data = NULL;
@@ -169,7 +168,7 @@ gfx_pixmap_t *gfx_pixmap_alloc_index_data(gfx_pixmap_t *pixmap) {
if (!size)
size = 1;
- pixmap->index_data = (byte*)sci_malloc(size);
+ pixmap->index_data = (byte*)malloc(size);
memset(pixmap->index_data, 0, size);
@@ -207,7 +206,7 @@ gfx_pixmap_t *gfx_pixmap_alloc_data(gfx_pixmap_t *pixmap, gfx_mode_t *mode) {
if (!size)
size = 1;
- pixmap->data = (byte*)sci_malloc(pixmap->data_size = size);
+ pixmap->data = (byte*)malloc(pixmap->data_size = size);
return pixmap;
}
@@ -251,7 +250,7 @@ gfx_pixmap_t *gfx_pixmap_scale_index_data(gfx_pixmap_t *pixmap, gfx_mode_t *mode
xl = pixmap->index_width;
yl = pixmap->index_height;
linewidth = xfact * xl;
- initial_new_data = new_data = (byte *)sci_malloc(linewidth * yfact * yl);
+ initial_new_data = new_data = (byte *)malloc(linewidth * yfact * yl);
for (yc = 0; yc < yl; yc++) {
diff --git a/engines/sci/gfx/gfx_widgets.cpp b/engines/sci/gfx/gfx_widgets.cpp
index 71ff4d82ff..9252fa750d 100644
--- a/engines/sci/gfx/gfx_widgets.cpp
+++ b/engines/sci/gfx/gfx_widgets.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_gui.h" // for kWindowAutoRestore
#include "sci/gfx/gfx_widgets.h"
#include "sci/gfx/gfx_state_internal.h"
@@ -1754,7 +1753,7 @@ GfxWidget *gfxw_show_widget(GfxWidget *widget) {
}
gfxw_snapshot_t *gfxw_make_snapshot(GfxVisual *visual, rect_t area) {
- gfxw_snapshot_t *retval = (gfxw_snapshot_t*)sci_malloc(sizeof(gfxw_snapshot_t));
+ gfxw_snapshot_t *retval = (gfxw_snapshot_t*)malloc(sizeof(gfxw_snapshot_t));
retval->serial = widget_serial_number_counter++;
diff --git a/engines/sci/gfx/menubar.cpp b/engines/sci/gfx/menubar.cpp
index 9237c9bb0c..f463b5c7c4 100644
--- a/engines/sci/gfx/menubar.cpp
+++ b/engines/sci/gfx/menubar.cpp
@@ -28,7 +28,6 @@
** used for any actual actions on behalf of the interpreter.
*/
-#include "sci/sci_memory.h"
#include "sci/engine/state.h"
#include "sci/gfx/menubar.h"
#include "sci/engine/kernel.h"
@@ -41,7 +40,7 @@ namespace Sci {
** Parameters: (char *) src: The source string
** (int) length: The maximum length of the string (not counting
** a trailing \0).
-** Returns : (char *) The resulting copy, allocated with sci_malloc().
+** Returns : (char *) The resulting copy, allocated with malloc().
** To free this string, use the free() command.
** See _SCI_MALLOC() for more information if call fails.
*/
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 87b5d4e483..9646b29c73 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -25,7 +25,6 @@
// Graphical operations, called from the widget state manager
-#include "sci/sci_memory.h"
#include "sci/gfx/operations.h"
#include "sci/gfx/font.h"
#include "sci/sci.h" // for g_engine, evil hack
diff --git a/engines/sci/gfx/res_font.cpp b/engines/sci/gfx/res_font.cpp
index c208fe16f0..7330df7441 100644
--- a/engines/sci/gfx/res_font.cpp
+++ b/engines/sci/gfx/res_font.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
@@ -64,7 +63,7 @@ static int calc_char(byte *dest, int total_width, int total_height, byte *src, i
}
gfx_bitmap_font_t *gfxr_read_font(int id, byte *resource, int size) {
- gfx_bitmap_font_t *font = (gfx_bitmap_font_t*)sci_calloc(sizeof(gfx_bitmap_font_t), 1);
+ gfx_bitmap_font_t *font = (gfx_bitmap_font_t*)calloc(sizeof(gfx_bitmap_font_t), 1);
int chars_nr;
int max_width = 0, max_height;
int i;
@@ -96,7 +95,7 @@ gfx_bitmap_font_t *gfxr_read_font(int id, byte *resource, int size) {
}
font->ID = id;
- font->widths = (int*)sci_malloc(sizeof(int) * chars_nr);
+ font->widths = (int*)malloc(sizeof(int) * chars_nr);
for (i = 0; i < chars_nr; i++) {
int offset = READ_LE_UINT16(resource + (i << 1) + 6);
@@ -125,7 +124,7 @@ gfx_bitmap_font_t *gfxr_read_font(int id, byte *resource, int size) {
font->row_size = (font->row_size + 3) & ~3;
font->char_size = font->row_size * max_height;
- font->data = (byte *)sci_calloc(font->char_size, chars_nr);
+ font->data = (byte *)calloc(font->char_size, chars_nr);
for (i = 0; i < chars_nr; i++) {
int offset = READ_LE_UINT16(resource + (i << 1) + 6);
diff --git a/engines/sci/gfx/res_pal.cpp b/engines/sci/gfx/res_pal.cpp
index ff76d3e20c..dbb6f8c221 100644
--- a/engines/sci/gfx/res_pal.cpp
+++ b/engines/sci/gfx/res_pal.cpp
@@ -26,7 +26,6 @@
/* SCI1 palette resource defrobnicator */
#include "common/file.h"
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h"
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 8c71bb2f49..5cf2b8ec6d 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -24,7 +24,6 @@
*/
#include <time.h> // for time() to seed rand() via srand()
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
@@ -148,7 +147,7 @@ void gfxr_init_static_palette() {
gfxr_pic_t *gfxr_init_pic(gfx_mode_t *mode, int ID, int sci1) {
- gfxr_pic_t *pic = (gfxr_pic_t*)sci_malloc(sizeof(gfxr_pic_t));
+ gfxr_pic_t *pic = (gfxr_pic_t*)malloc(sizeof(gfxr_pic_t));
pic->mode = mode;
@@ -1569,7 +1568,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
p0printf("Explicit priority table @%d\n", pos);
if (!pic->priorityTable) {
- pic->priorityTable = (int*)sci_malloc(16 * sizeof(int));
+ pic->priorityTable = (int*)malloc(16 * sizeof(int));
} else {
// This occurs in the title screen of Longbow, perhaps with the animated Robin sprite
GFXWARN("pic->priorityTable is not NULL (%p); this only occurs with overlaid pics, otherwise it's a bug", (void *)pic->priorityTable);
@@ -1592,7 +1591,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
int *pri_table;
if (!pic->priorityTable) {
- pic->priorityTable = (int*)sci_malloc(16 * sizeof(int));
+ pic->priorityTable = (int*)malloc(16 * sizeof(int));
} else {
GFXERROR("pic->priorityTable is not NULL (%p); possible memory corruption", (void *)pic->priorityTable);
}
diff --git a/engines/sci/gfx/res_view0.cpp b/engines/sci/gfx/res_view0.cpp
index dd01ae4ad0..efc5cccc95 100644
--- a/engines/sci/gfx/res_view0.cpp
+++ b/engines/sci/gfx/res_view0.cpp
@@ -25,7 +25,6 @@
#include "common/endian.h"
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
@@ -132,7 +131,7 @@ static int gfxr_draw_loop0(gfxr_loop_t *dest, int id, int loop, byte *resource,
return 1;
}
- dest->cels = (gfx_pixmap_t**)sci_malloc(sizeof(gfx_pixmap_t *) * cels_nr);
+ dest->cels = (gfx_pixmap_t**)malloc(sizeof(gfx_pixmap_t *) * cels_nr);
for (i = 0; i < cels_nr; i++) {
int cel_offset = READ_LE_UINT16(resource + offset + 4 + (i << 1));
@@ -174,7 +173,7 @@ gfxr_view_t *gfxr_draw_view0(int id, byte *resource, int size, int palette) {
return NULL;
}
- view = (gfxr_view_t *)sci_malloc(sizeof(gfxr_view_t));
+ view = (gfxr_view_t *)malloc(sizeof(gfxr_view_t));
view->ID = id;
view->loops_nr = resource[V0_LOOPS_NR_OFFSET];
@@ -198,7 +197,7 @@ gfxr_view_t *gfxr_draw_view0(int id, byte *resource, int size, int palette) {
return NULL;
}
- view->loops = (gfxr_loop_t*)sci_malloc(sizeof(gfxr_loop_t) * ((view->loops_nr) ? view->loops_nr : 1)); /* Alloc 1 if no loop */
+ view->loops = (gfxr_loop_t*)malloc(sizeof(gfxr_loop_t) * ((view->loops_nr) ? view->loops_nr : 1)); /* Alloc 1 if no loop */
for (i = 0; i < view->loops_nr; i++) {
int error_token = 0;
diff --git a/engines/sci/gfx/res_view1.cpp b/engines/sci/gfx/res_view1.cpp
index eea8aa3259..2b0c7439a1 100644
--- a/engines/sci/gfx/res_view1.cpp
+++ b/engines/sci/gfx/res_view1.cpp
@@ -27,7 +27,6 @@
#include "common/endian.h"
-#include "sci/sci_memory.h"
#include "sci/gfx/gfx_system.h"
#include "sci/gfx/gfx_resource.h"
#include "sci/gfx/gfx_tools.h"
@@ -249,7 +248,7 @@ static int gfxr_draw_loop1(gfxr_loop_t *dest, int id, int loop, int mirrored, by
return 1;
}
- dest->cels = (gfx_pixmap_t**)sci_malloc(sizeof(gfx_pixmap_t *) * cels_nr);
+ dest->cels = (gfx_pixmap_t**)malloc(sizeof(gfx_pixmap_t *) * cels_nr);
for (i = 0; i < cels_nr; i++) {
int cel_offset = READ_LE_UINT16(resource + offset + 4 + (i << 1));
@@ -286,7 +285,7 @@ gfxr_view_t *gfxr_draw_view1(int id, byte *resource, int size, Palette *static_p
return NULL;
}
- view = (gfxr_view_t*)sci_malloc(sizeof(gfxr_view_t));
+ view = (gfxr_view_t*)malloc(sizeof(gfxr_view_t));
view->ID = id;
view->flags = 0;
@@ -320,7 +319,7 @@ gfxr_view_t *gfxr_draw_view1(int id, byte *resource, int size, Palette *static_p
view->palette = NULL;
}
- view->loops = (gfxr_loop_t*)sci_malloc(sizeof(gfxr_loop_t) * view->loops_nr);
+ view->loops = (gfxr_loop_t*)malloc(sizeof(gfxr_loop_t) * view->loops_nr);
for (i = 0; i < view->loops_nr; i++) {
int error_token = 0;
@@ -348,7 +347,7 @@ gfxr_loop_t *gfxr_draw_loop11(int id, int loop, int mirrored, byte *resource_bas
int i;
result->cels_nr = cels_nr;
- result->cels = (gfx_pixmap_t **)sci_malloc(sizeof(gfx_pixmap_t *) * cels_nr);
+ result->cels = (gfx_pixmap_t **)malloc(sizeof(gfx_pixmap_t *) * cels_nr);
for (i = 0; i < cels_nr; i++) {
result->cels[i] = gfxr_draw_cel1(id, loop, i, mirrored, resource_base, seeker, size, view, 0, true);
@@ -368,7 +367,7 @@ gfxr_view_t *gfxr_draw_view11(int id, byte *resource, int size) {
int i;
byte *seeker;
- view = (gfxr_view_t *)sci_malloc(sizeof(gfxr_view_t));
+ view = (gfxr_view_t *)malloc(sizeof(gfxr_view_t));
memset(view, 0, sizeof(gfxr_view_t));
view->ID = id;