diff options
Diffstat (limited to 'engines/sci/engine/kgraphics32.cpp')
-rw-r--r-- | engines/sci/engine/kgraphics32.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index 44085da6e7..e458109cc2 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -536,13 +536,14 @@ reg_t kBitmapCreate(EngineState *s, int argc, reg_t *argv) { int16 scaledHeight = argc > 5 ? argv[5].toSint16() : g_sci->_gfxText32->_scaledHeight; bool useRemap = argc > 6 ? argv[6].toSint16() : false; - BitmapResource bitmap(s->_segMan, width, height, skipColor, 0, 0, scaledWidth, scaledHeight, 0, useRemap, true); + reg_t bitmapId; + SciBitmap &bitmap = *s->_segMan->allocateBitmap(&bitmapId, width, height, skipColor, 0, 0, scaledWidth, scaledHeight, 0, useRemap, true); memset(bitmap.getPixels(), backColor, width * height); - return bitmap.getObject(); + return bitmapId; } reg_t kBitmapDestroy(EngineState *s, int argc, reg_t *argv) { - s->_segMan->freeHunkEntry(argv[0]); + s->_segMan->freeBitmap(argv[0]); return s->r_acc; } @@ -552,7 +553,7 @@ reg_t kBitmapDrawLine(EngineState *s, int argc, reg_t *argv) { } reg_t kBitmapDrawView(EngineState *s, int argc, reg_t *argv) { - BitmapResource bitmap(argv[0]); + SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]); CelObjView view(argv[1].toUint16(), argv[2].toSint16(), argv[3].toSint16()); const int16 x = argc > 4 ? argv[4].toSint16() : 0; @@ -582,7 +583,7 @@ reg_t kBitmapDrawView(EngineState *s, int argc, reg_t *argv) { reg_t kBitmapDrawText(EngineState *s, int argc, reg_t *argv) { // called e.g. from TextButton::createBitmap() in Torin's Passage, script 64894 - BitmapResource bitmap(argv[0]); + SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]); Common::String text = s->_segMan->getString(argv[1]); Common::Rect textRect( argv[2].toSint16(), @@ -609,7 +610,7 @@ reg_t kBitmapDrawText(EngineState *s, int argc, reg_t *argv) { reg_t textBitmapObject = g_sci->_gfxText32->createFontBitmap(textRect.width(), textRect.height(), Common::Rect(textRect.width(), textRect.height()), text, foreColor, backColor, skipColor, fontId, alignment, borderColor, dimmed, false, false); CelObjMem textCel(textBitmapObject); textCel.draw(bitmap.getBuffer(), textRect, Common::Point(textRect.left, textRect.top), false); - s->_segMan->freeHunkEntry(textBitmapObject); + s->_segMan->freeBitmap(textBitmapObject); return s->r_acc; } @@ -617,7 +618,7 @@ reg_t kBitmapDrawText(EngineState *s, int argc, reg_t *argv) { reg_t kBitmapDrawColor(EngineState *s, int argc, reg_t *argv) { // called e.g. from TextView::init() and TextView::draw() in Torin's Passage, script 64890 - BitmapResource bitmap(argv[0]); + SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]); Common::Rect fillRect( argv[1].toSint16(), argv[2].toSint16(), @@ -642,7 +643,7 @@ reg_t kBitmapInvert(EngineState *s, int argc, reg_t *argv) { } reg_t kBitmapSetDisplace(EngineState *s, int argc, reg_t *argv) { - BitmapResource bitmap(argv[0]); + SciBitmap &bitmap = *s->_segMan->lookupBitmap(argv[0]); bitmap.setDisplace(Common::Point(argv[1].toSint16(), argv[2].toSint16())); return s->r_acc; } |