aboutsummaryrefslogtreecommitdiff
path: root/scumm/gfx.cpp
diff options
context:
space:
mode:
authorMax Horn2003-04-12 11:44:15 +0000
committerMax Horn2003-04-12 11:44:15 +0000
commita236803241fb1ba81a1bd25e8b78ec7fe8d8d3f9 (patch)
tree550cf2a742fa97167a97789f31f2a89a5a369ac1 /scumm/gfx.cpp
parentbab3f0d9f9bc6ec00ab2da96ad14e727dba9dab9 (diff)
downloadscummvm-rg350-a236803241fb1ba81a1bd25e8b78ec7fe8d8d3f9.tar.gz
scummvm-rg350-a236803241fb1ba81a1bd25e8b78ec7fe8d8d3f9.tar.bz2
scummvm-rg350-a236803241fb1ba81a1bd25e8b78ec7fe8d8d3f9.zip
cleanup
svn-id: r6984
Diffstat (limited to 'scumm/gfx.cpp')
-rw-r--r--scumm/gfx.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index a3e00e8463..a399e3b39f 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -1046,12 +1046,12 @@ next_iter:
void Gdi::decodeStripEGA(byte *dst, byte *src, int height) {
byte color = 0;
- int run = 0, x = 0, y = 0;
+ int run = 0, x = 0, y = 0, z;
- while(x < 8){
+ while(x < 8) {
color = *src++;
- if(color >= 0x80) {
+ if(color & 0x80) {
run = color & 0x3f;
if(color & 0x40) {
@@ -1060,46 +1060,43 @@ void Gdi::decodeStripEGA(byte *dst, byte *src, int height) {
if(run == 0) {
run = *src++;
}
+ const register byte colors[2] = { color >> 4, color & 0xf };
+ for(z = 0; z < run; z++) {
- for(int z = 0; z < run; z++) {
-
- if(z & 1) {
- *(dst + y * _vm->_realWidth + x) = _vm->_shadowPalette[color & 0xf];
- } else {
- *(dst + y * _vm->_realWidth + x) = _vm->_shadowPalette[color >> 4];
- }
+ *(dst + y * _vm->_realWidth + x) = _vm->_shadowPalette[ colors[z&1] ];
y++;
- if(y >= height){
+ if(y >= height) {
y = 0;
x++;
}
}
- } else{
+ } else {
if(run == 0) {
run = *src++;
}
- for(int z = 0; z < run; z++) {
+ for(z = 0; z < run; z++) {
*(dst + y * _vm->_realWidth + x) = *(dst + y * _vm->_realWidth + x - 1);
+
y++;
- if(y >= height){
+ if(y >= height) {
y = 0;
x++;
}
- }
+ }
}
- } else if(color < 0x80){
+ } else {
run = color >> 4;
if(run == 0) {
run = *src++;
}
- for(int z = 0; z < run; z++) {
+ for(z = 0; z < run; z++) {
*(dst + y * _vm->_realWidth + x) = _vm->_shadowPalette[color & 0xf];
- y++;
- if(y >= height){
+ y++;
+ if(y >= height) {
y = 0;
x++;
}