From c012c762d014c4c77ab5165b0c45b3c51ec34149 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 1 Aug 2014 19:22:12 +0200 Subject: CGE2: Remove moveHi() and moveLo() from bitmap --- engines/cge2/bitmap.cpp | 14 +++----------- engines/cge2/bitmap.h | 2 -- engines/cge2/hero.cpp | 2 -- engines/cge2/vga13h.cpp | 9 +++------ 4 files changed, 6 insertions(+), 21 deletions(-) (limited to 'engines/cge2') diff --git a/engines/cge2/bitmap.cpp b/engines/cge2/bitmap.cpp index 2c7c010d53..6629919118 100644 --- a/engines/cge2/bitmap.cpp +++ b/engines/cge2/bitmap.cpp @@ -398,16 +398,6 @@ void Bitmap::xLatPos(V2D& p) { p.y = kWorldHeight - p.y - _h; } -bool Bitmap::moveHi() { - // No implementation needed in ScummVM - return true; -} - -bool Bitmap::moveLo() { - // No implementation needed in ScummVM - return true; -} - #define _ kPixelTransp, #define L 1, #define G 2, @@ -466,9 +456,11 @@ uint8 *Bitmap::makeSpeechBubbleTail(int which, uint8 colorSet[][4]) { break; } - for (int i = 0; i < kDesignSize; i++) + for (int i = 0; i < kDesignSize; i++) { if (des[i] >= 1 && des[i] <= 3) des[i] = colorSet[kCBSay][des[i]]; + } + return des; } diff --git a/engines/cge2/bitmap.h b/engines/cge2/bitmap.h index 8643c37467..30b8f487c5 100644 --- a/engines/cge2/bitmap.h +++ b/engines/cge2/bitmap.h @@ -82,8 +82,6 @@ public: void show(V2D pos); bool solidAt(V2D pos); void xLatPos(V2D& p); - bool moveHi(); - bool moveLo(); static uint8 *makeSpeechBubbleTail(int des, uint8 colorSet[][4]); }; diff --git a/engines/cge2/hero.cpp b/engines/cge2/hero.cpp index 0b8e227590..821b7386ee 100644 --- a/engines/cge2/hero.cpp +++ b/engines/cge2/hero.cpp @@ -173,8 +173,6 @@ Sprite *Hero::expand() { char *q = p; q[1] = '0' + i; Bitmap b(_vm, q); - if (!b.moveHi()) - error("No EMS %s", q); _dim[i][shpcnt] = b; if (!shpcnt) _hig[i] = b._h; diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp index cdf683d380..1895c319dc 100644 --- a/engines/cge2/vga13h.cpp +++ b/engines/cge2/vga13h.cpp @@ -422,8 +422,6 @@ Sprite *Sprite::expand() { break; case kIdPhase: shplist[shpcnt] = Bitmap(_vm, p); - if (!shplist[shpcnt].moveHi()) - error("No EMS"); shpcnt++; break; default: @@ -957,11 +955,11 @@ uint8 Vga::closest(Dac *pal, const uint8 colR, const uint8 colG, const uint8 col uint8 Vga::closest(Dac *pal, Dac x) { int exp = (sizeof(long) * 8 - 1); - long D = (1 << exp) - 1; // Maximume value of long. + long D = (1 << exp) - 1; // Maximum value of long. long R = x._r; long G = x._g; long B = x._b; - int idx; + int idx = 255; for (int n = 0; n < 256; n++) { long dR = R - pal[n]._r; long dG = G - pal[n]._g; @@ -980,8 +978,7 @@ uint8 Vga::closest(Dac *pal, Dac x) { uint8 *Vga::glass(Dac *pal, const uint8 colR, const uint8 colG, const uint8 colB) { uint8 *x = (uint8 *)malloc(256); if (x) { - uint16 i; - for (i = 0; i < 256; i++) { + for (uint16 i = 0; i < 256; i++) { x[i] = closest(pal, ((uint16)(pal[i]._r) * colR) / 255, ((uint16)(pal[i]._g) * colG) / 255, ((uint16)(pal[i]._b) * colB) / 255); -- cgit v1.2.3