scummvm/backends/PalmOS/Src/arm/blit.cpp

53 lines
1,004 B
C++
Raw Normal View History

2004-10-06 09:35:02 +00:00
#include "native.h"
#include "endianutils.h"
#define MAIN_TYPE BlitType
#include "macros.h"
#define memcpy MemMove
2004-12-20 17:38:31 +00:00
UInt32 Display_blit(void *userData68KP) {
2004-10-06 09:35:02 +00:00
// import variables
SETPTR (uint8 *, dstBuf )
SETPTR (const uint8 *, srcBuf )
SET16 (uint16, dstPitch )
SET16 (uint16, srcPitch )
SET16 (uint16, w )
SET16 (uint16, h )
SET8 (bool, xflip )
SET8 (bool, masked )
// end of import
if (!masked) { // Unmasked always unflipped
while (h--) {
memcpy(dstBuf, srcBuf, w);
srcBuf += srcPitch;
dstBuf += dstPitch;
}
} else if (!xflip) { // Masked bitmap unflipped
while (h--) {
for(int i = 0; i < w; ++i) {
uint8 b = *(srcBuf + i);
if(b != 0) {
*(dstBuf + i) = b;
}
}
srcBuf += srcPitch;
dstBuf += dstPitch;
}
} else { // Masked bitmap flipped
while (h--) {
for(int i = 0; i < w; ++i) {
uint8 b = *(srcBuf + i);
if(b != 0) {
*(dstBuf - i) = b;
}
}
srcBuf += srcPitch;
dstBuf += dstPitch;
}
}
2004-12-20 17:38:31 +00:00
return 0;
}