aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-18 13:05:09 +0000
committerFilippos Karapetis2010-05-18 13:05:09 +0000
commitf3892a506b2f935bae0be6319394c503c786d368 (patch)
tree2edf8570fa4076c0af6aec863999dbf6cc3daddd /engines/sci/graphics
parente3297ef2cad4b0efc4b262d73b1be4630497dd4a (diff)
downloadscummvm-rg350-f3892a506b2f935bae0be6319394c503c786d368.tar.gz
scummvm-rg350-f3892a506b2f935bae0be6319394c503c786d368.tar.bz2
scummvm-rg350-f3892a506b2f935bae0be6319394c503c786d368.zip
- Removed the wrapper kalloc, kmem and kfree functions. Now, the associated Segment manager functions allocateHunkEntry, getHunkPointer and freeHunkEntry are used directly (which are more descriptive, anyway)
- Replaced the GET_SEGMENT macro by a method of the segment manager - Removed the unused reference to the created hunk in allocateHunkEntry(), only the reg_t reference to it is returned now svn-id: r49078
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r--engines/sci/graphics/paint16.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/engines/sci/graphics/paint16.cpp b/engines/sci/graphics/paint16.cpp
index 5f78b18b1e..d0975f3d3d 100644
--- a/engines/sci/graphics/paint16.cpp
+++ b/engines/sci/graphics/paint16.cpp
@@ -135,7 +135,7 @@ void GfxPaint16::drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 c
// I'm not sure if this is what we are supposed to do or if there is some other bug that actually makes
// coordinates to be 0 in the first place
byte *memoryPtr = NULL;
- memoryPtr = kmem(_segMan, upscaledHiresHandle);
+ memoryPtr = _segMan->getHunkPointer(upscaledHiresHandle);
if (memoryPtr) {
Common::Rect upscaledHiresRect;
_screen->bitsGetRect(memoryPtr, &upscaledHiresRect);
@@ -322,8 +322,8 @@ reg_t GfxPaint16::bitsSave(const Common::Rect &rect, byte screenMask) {
// now actually ask _screen how much space it will need for saving
size = _screen->bitsGetDataSize(workerRect, screenMask);
- memoryId = kalloc(_segMan, "SaveBits()", size);
- memoryPtr = kmem(_segMan, memoryId);
+ memoryId = _segMan->allocateHunkEntry("SaveBits()", size);
+ memoryPtr = _segMan->getHunkPointer(memoryId);
_screen->bitsSave(workerRect, screenMask, memoryPtr);
return memoryId;
}
@@ -332,7 +332,7 @@ void GfxPaint16::bitsGetRect(reg_t memoryHandle, Common::Rect *destRect) {
byte *memoryPtr = NULL;
if (!memoryHandle.isNull()) {
- memoryPtr = kmem(_segMan, memoryHandle);
+ memoryPtr = _segMan->getHunkPointer(memoryHandle);
if (memoryPtr) {
_screen->bitsGetRect(memoryPtr, destRect);
@@ -344,19 +344,17 @@ void GfxPaint16::bitsRestore(reg_t memoryHandle) {
byte *memoryPtr = NULL;
if (!memoryHandle.isNull()) {
- memoryPtr = kmem(_segMan, memoryHandle);
+ memoryPtr = _segMan->getHunkPointer(memoryHandle);
if (memoryPtr) {
_screen->bitsRestore(memoryPtr);
- kfree(_segMan, memoryHandle);
+ _segMan->freeHunkEntry(memoryHandle);
}
}
}
void GfxPaint16::bitsFree(reg_t memoryHandle) {
- if (!memoryHandle.isNull()) {
- kfree(_segMan, memoryHandle);
- }
+ _segMan->freeHunkEntry(memoryHandle);
}
void GfxPaint16::kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {