diff options
Diffstat (limited to 'scumm/smush/blitter.cpp')
-rw-r--r-- | scumm/smush/blitter.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/scumm/smush/blitter.cpp b/scumm/smush/blitter.cpp index d760919869..38116dbbf5 100644 --- a/scumm/smush/blitter.cpp +++ b/scumm/smush/blitter.cpp @@ -27,7 +27,7 @@ #include <assert.h> #include <string.h> // for memcpy -Blitter::Blitter(char * ptr, const Point & dstsize, const Rect & src) : +Blitter::Blitter(byte * ptr, const Point & dstsize, const Rect & src) : _ptr(ptr), _clip(dstsize), _src(src), @@ -53,7 +53,7 @@ Blitter::~Blitter() { #endif } -void Blitter::advance(int x, int y) { +void Blitter::advance(int32 x, int32 y) { if(y != 0) { _cur.set(_src.left() + x, _cur.getY() + y); } else { @@ -66,11 +66,11 @@ void Blitter::advance(int x, int y) { _outside = ! _src.isInside(_cur); } -void Blitter::advanceBlock(int x, int y) { - advance(x*4, y*4); +void Blitter::advanceBlock(int32 x, int32 y) { + advance(x * 4, y * 4); } -void Blitter::put(char data) { +void Blitter::put(byte data) { if(!_outside) { *_offset = data; advance(); @@ -80,7 +80,7 @@ void Blitter::put(char data) { #endif } -void Blitter::put(char data, unsigned int len) { +void Blitter::put(byte data, uint32 len) { while(len) { if(_outside) { #ifdef DEBUG_CLIPPER @@ -88,14 +88,14 @@ void Blitter::put(char data, unsigned int len) { #endif break; } - int l = MIN((int)len, MIN(_clip.getX() - _cur.getX(), _src.right() - _cur.getX())); + int32 l = MIN((int32)len, MIN(_clip.getX() - _cur.getX(), _src.right() - _cur.getX())); len -= l; memset(_offset, data, l); advance(l); } } -void Blitter::blit(char * ptr, unsigned int len) { +void Blitter::blit(byte * ptr, uint32 len) { while(len) { if(_outside) { #ifdef DEBUG_CLIPPER @@ -103,7 +103,7 @@ void Blitter::blit(char * ptr, unsigned int len) { #endif break; } - int l = MIN((int)len, MIN(_clip.getX() - _cur.getX(), _src.right() - _cur.getX())); + int32 l = MIN((int32)len, MIN(_clip.getX() - _cur.getX(), _src.right() - _cur.getX())); len -= l; memcpy(_offset, ptr, l); ptr += l; @@ -111,7 +111,7 @@ void Blitter::blit(char * ptr, unsigned int len) { } } -void Blitter::blit(Chunk & src, unsigned int len) { +void Blitter::blit(Chunk & src, uint32 len) { while(len) { if(_outside) { #ifdef DEBUG_CLIPPER @@ -119,18 +119,18 @@ void Blitter::blit(Chunk & src, unsigned int len) { #endif break; } - int l = MIN((int)len, MIN(_clip.getX() -_cur.getX(), _src.right() - _cur.getX())); + int32 l = MIN((int32)len, MIN(_clip.getX() -_cur.getX(), _src.right() - _cur.getX())); len -= l; src.read(_offset, l); advance(l); } } -void Blitter::putBlock(unsigned int data) { +void Blitter::putBlock(uint32 data) { if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) { // This is clipping assert((_clip.getX() & 3) == 0); - unsigned int * dst = (unsigned int *)_offset; - int line_size = _clip.getX() >> 2; + uint32 * dst = (uint32 *)_offset; + int32 line_size = _clip.getX() >> 2; data = TO_LE_32(data); *dst = data; dst += line_size; @@ -146,11 +146,11 @@ void Blitter::putBlock(unsigned int data) { advanceBlock(); } -void Blitter::putBlock(unsigned int d1, unsigned int d2, unsigned int d3, unsigned int d4) { +void Blitter::putBlock(uint32 d1, uint32 d2, uint32 d3, uint32 d4) { if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) { // This is clipping assert((_clip.getX() & 3) == 0); - unsigned int * dst = (unsigned int *)_offset; - int line_size = _clip.getX() >> 2; + uint32 * dst = (uint32 *)_offset; + int32 line_size = _clip.getX() >> 2; *dst = TO_LE_32(d4); dst += line_size; *dst = TO_LE_32(d3); dst += line_size; @@ -165,12 +165,12 @@ void Blitter::putBlock(unsigned int d1, unsigned int d2, unsigned int d3, unsign advanceBlock(); } -void Blitter::putBlock(unsigned char * data) { +void Blitter::putBlock(byte * data) { if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) { // This is clipping assert((_clip.getX() & 3) == 0); - unsigned int * dst = (unsigned int *)_offset; - int line_size = _clip.getX() >> 2; - unsigned int * src = (unsigned int *)data; + uint32 * dst = (uint32 *)_offset; + int32 line_size = _clip.getX() >> 2; + uint32 * src = (uint32 *)data; *dst = TO_LE_32(*src++); dst += line_size; *dst = TO_LE_32(*src++); dst += line_size; *dst = TO_LE_32(*src++); dst += line_size; @@ -186,8 +186,8 @@ void Blitter::putBlock(unsigned char * data) { void Blitter::putBlock(Chunk & src) { if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) { // This is clipping assert((_clip.getX() & 3) == 0); - unsigned int * dst = (unsigned int *)_offset; - int line_size = _clip.getX() >> 2; + uint32 * dst = (uint32 *)_offset; + int32 line_size = _clip.getX() >> 2; *dst = TO_LE_32(src.getDword()); dst += line_size; *dst = TO_LE_32(src.getDword()); dst += line_size; *dst = TO_LE_32(src.getDword()); dst += line_size; @@ -200,16 +200,16 @@ void Blitter::putBlock(Chunk & src) { advanceBlock(); } -void Blitter::blockCopy(int offset) { +void Blitter::blockCopy(int32 offset) { if(_cur.getX() + 3 < _src.right() && _cur.getY() + 3 < _src.bottom()) {// This is clipping - char * dst = _offset; - *((unsigned int *)dst) = *((unsigned int *)(dst + offset)); + byte * dst = _offset; + *((uint32 *)dst) = *((uint32 *)(dst + offset)); dst += _clip.getX(); - *((unsigned int *)dst) = *((unsigned int *)(dst + offset)); + *((uint32 *)dst) = *((uint32 *)(dst + offset)); dst += _clip.getX(); - *((unsigned int *)dst) = *((unsigned int *)(dst + offset)); + *((uint32 *)dst) = *((uint32 *)(dst + offset)); dst += _clip.getX(); - *((unsigned int *)dst) = *((unsigned int *)(dst + offset)); + *((uint32 *)dst) = *((uint32 *)(dst + offset)); #ifdef DEBUG_CLIPPER } else { _clippedBlock ++; |