mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
CGE: rename constants in bitmap
This commit is contained in:
+20
-21
@@ -38,7 +38,6 @@
|
||||
namespace CGE {
|
||||
|
||||
Dac *Bitmap::_pal = NULL;
|
||||
#define MAXPATH 128
|
||||
|
||||
void Bitmap::init() {
|
||||
_pal = NULL;
|
||||
@@ -51,7 +50,7 @@ void Bitmap::deinit() {
|
||||
Bitmap::Bitmap(const char *fname, bool rem) : _m(NULL), _v(NULL), _map(0) {
|
||||
debugC(1, kDebugBitmap, "Bitmap::Bitmap(%s, %s)", fname, rem ? "true" : "false");
|
||||
|
||||
char pat[MAXPATH];
|
||||
char pat[kMaxPath];
|
||||
forceExt(pat, fname, ".VBM");
|
||||
|
||||
#if (BMP_MODE < 2)
|
||||
@@ -107,16 +106,16 @@ Bitmap::Bitmap(uint16 w, uint16 h, uint8 fill)
|
||||
if (v == NULL)
|
||||
error("No core");
|
||||
|
||||
*(uint16 *) v = CPY | dsiz; // data chunk hader
|
||||
*(uint16 *) v = kBmpCPY | dsiz; // data chunk hader
|
||||
memset(v + 2, fill, dsiz); // data bytes
|
||||
*(uint16 *)(v + lsiz - 2) = SKP | ((SCR_WID / 4) - dsiz); // gap
|
||||
*(uint16 *)(v + lsiz - 2) = kBmpSKP | ((SCR_WID / 4) - dsiz); // gap
|
||||
|
||||
// Replicate lines
|
||||
byte *destP;
|
||||
for (destP = v + lsiz; destP < (v + psiz); destP += lsiz)
|
||||
Common::copy(v, v + lsiz, destP);
|
||||
|
||||
*(uint16 *)(v + psiz - 2) = EOI; // plane trailer uint16
|
||||
*(uint16 *)(v + psiz - 2) = kBmpEOI; // plane trailer uint16
|
||||
|
||||
// Repliccate planes
|
||||
for (destP = v + psiz; destP < (v + 4 * psiz); destP += psiz)
|
||||
@@ -224,7 +223,7 @@ BMP_PTR Bitmap::code() {
|
||||
}
|
||||
for (bpl = 0; bpl < 4; bpl++) { // once per each bitplane
|
||||
uint8 *bm = _m;
|
||||
bool skip = (bm[bpl] == TRANS);
|
||||
bool skip = (bm[bpl] == kPixelTransp);
|
||||
uint16 j;
|
||||
|
||||
cnt = 0;
|
||||
@@ -232,21 +231,21 @@ BMP_PTR Bitmap::code() {
|
||||
uint8 pix;
|
||||
for (j = bpl; j < _w; j += 4) {
|
||||
pix = bm[j];
|
||||
if (_v && pix != TRANS) {
|
||||
if (_v && pix != kPixelTransp) {
|
||||
if (j < _b[i]._skip)
|
||||
_b[i]._skip = j;
|
||||
|
||||
if (j >= _b[i]._hide)
|
||||
_b[i]._hide = j + 1;
|
||||
}
|
||||
if ((pix == TRANS) != skip || cnt >= 0x3FF0) { // end of block
|
||||
cnt |= (skip) ? SKP : CPY;
|
||||
if ((pix == kPixelTransp) != skip || cnt >= 0x3FF0) { // end of block
|
||||
cnt |= (skip) ? kBmpSKP : kBmpCPY;
|
||||
if (_v)
|
||||
*cp = cnt; // store block description uint16
|
||||
|
||||
cp = (uint16 *) im;
|
||||
im += 2;
|
||||
skip = (pix == TRANS);
|
||||
skip = (pix == kPixelTransp);
|
||||
cnt = 0;
|
||||
}
|
||||
if (! skip) {
|
||||
@@ -262,7 +261,7 @@ BMP_PTR Bitmap::code() {
|
||||
if (skip) {
|
||||
cnt += (SCR_WID - j + 3) / 4;
|
||||
} else {
|
||||
cnt |= CPY;
|
||||
cnt |= kBmpCPY;
|
||||
if (_v)
|
||||
*cp = cnt;
|
||||
|
||||
@@ -274,7 +273,7 @@ BMP_PTR Bitmap::code() {
|
||||
}
|
||||
}
|
||||
if (cnt && ! skip) {
|
||||
cnt |= CPY;
|
||||
cnt |= kBmpCPY;
|
||||
if (_v)
|
||||
*cp = cnt;
|
||||
|
||||
@@ -282,7 +281,7 @@ BMP_PTR Bitmap::code() {
|
||||
im += 2;
|
||||
}
|
||||
if (_v)
|
||||
*cp = EOI;
|
||||
*cp = kBmpEOI;
|
||||
cp = (uint16 *) im;
|
||||
im += 2;
|
||||
}
|
||||
@@ -336,12 +335,12 @@ bool Bitmap::solidAt(int16 x, int16 y) {
|
||||
w &= 0x3FFF;
|
||||
|
||||
switch (t) {
|
||||
case EOI :
|
||||
case kBmpEOI:
|
||||
r--;
|
||||
case SKP :
|
||||
case kBmpSKP:
|
||||
w = 0;
|
||||
break;
|
||||
case REP :
|
||||
case kBmpREP:
|
||||
w = 1;
|
||||
break;
|
||||
}
|
||||
@@ -361,18 +360,18 @@ bool Bitmap::solidAt(int16 x, int16 y) {
|
||||
|
||||
n += w;
|
||||
switch (t) {
|
||||
case EOI :
|
||||
case kBmpEOI:
|
||||
return false;
|
||||
case SKP :
|
||||
case kBmpSKP:
|
||||
w = 0;
|
||||
break;
|
||||
case REP :
|
||||
case CPY :
|
||||
case kBmpREP:
|
||||
case kBmpCPY:
|
||||
if (n - w <= n0 && n > n0)
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
m += ((t == REP) ? 1 : w);
|
||||
m += ((t == kBmpREP) ? 1 : w);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,12 +32,12 @@
|
||||
|
||||
namespace CGE {
|
||||
|
||||
#define EOI 0x0000
|
||||
#define SKP 0x4000
|
||||
#define REP 0x8000
|
||||
#define CPY 0xC000
|
||||
#define kBmpEOI 0x0000
|
||||
#define kBmpSKP 0x4000
|
||||
#define kBmpREP 0x8000
|
||||
#define kBmpCPY 0xC000
|
||||
|
||||
#define TRANS 0xFE
|
||||
#define kMaxPath 128
|
||||
|
||||
#include "common/pack-start.h"
|
||||
|
||||
|
||||
@@ -91,9 +91,6 @@ enum Keys {
|
||||
TwiceRight
|
||||
};
|
||||
|
||||
//extern uint16 _stklen;
|
||||
//extern uint16 _heaplen;
|
||||
|
||||
} // End of namespace CGE
|
||||
|
||||
#endif
|
||||
|
||||
@@ -210,10 +210,10 @@ Bitmap *Talk::box(uint16 w, uint16 h) {
|
||||
for (int i = 0; i < r; i++) {
|
||||
int j;
|
||||
for (j = 0; j < r - i; j++) {
|
||||
p[j] = TRANS;
|
||||
p[w - j - 1] = TRANS;
|
||||
q[j] = TRANS;
|
||||
q[w - j - 1] = TRANS;
|
||||
p[j] = kPixelTransp;
|
||||
p[w - j - 1] = kPixelTransp;
|
||||
q[j] = kPixelTransp;
|
||||
q[w - j - 1] = kPixelTransp;
|
||||
}
|
||||
p[j] = LGRAY;
|
||||
p[w - j - 1] = DGRAY;
|
||||
@@ -305,7 +305,7 @@ void InfoLine::update(const char *tx) {
|
||||
for (pDest = v + lsiz; pDest < (v + psiz); pDest += lsiz) {
|
||||
Common::copy(v, v + lsiz, pDest);
|
||||
}
|
||||
*(uint16 *)(v + psiz - 2) = EOI; // plane trailer uint16
|
||||
*(uint16 *)(v + psiz - 2) = kBmpEOI; // plane trailer uint16
|
||||
for (pDest = v + psiz; pDest < (v + 4 * psiz); pDest += psiz) {
|
||||
Common::copy(v, v + psiz, pDest);
|
||||
}
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace CGE {
|
||||
#define DGRAY 225 /*219*/
|
||||
#define GRAY 231
|
||||
#define LGRAY 237
|
||||
#define kPixelTransp 0xFE
|
||||
|
||||
#define NO_SEQ (-1)
|
||||
#define NO_PTR ((uint8)-1)
|
||||
|
||||
@@ -36,7 +36,7 @@ MenuBar::MenuBar(CGEEngine *vm, uint16 w) : Talk(vm), _vm(vm) {
|
||||
int i = (w += 2 * kMenuBarHM) * h;
|
||||
uint8 *p = (uint8 *) malloc(sizeof(uint8) * i);
|
||||
|
||||
memset(p + w, TRANS, i - 2 * w);
|
||||
memset(p + w, kPixelTransp, i - 2 * w);
|
||||
memset(p, kMenuBarLT, w);
|
||||
memset(p + i - w, kMenuBarRB, w);
|
||||
uint8 *p1 = p;
|
||||
|
||||
Reference in New Issue
Block a user