[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.10,1.11 scaler.h,1.5,1.6
Max Horn
fingolfin at users.sourceforge.net
Fri Apr 25 13:04:22 CEST 2003
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv20908/common
Modified Files:
scaler.cpp scaler.h
Log Message:
cleanup; added comment
Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- scaler.cpp 28 Mar 2003 19:13:59 -0000 1.10
+++ scaler.cpp 25 Apr 2003 20:02:57 -0000 1.11
@@ -155,8 +155,7 @@
#define RED_MASK555 0x7C007C00
#define GREEN_MASK555 0x03E003E0
-void Super2xSaI(uint8 *srcPtr, uint32 srcPitch,
- uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint16 *bP;
uint8 *dP;
uint32 inc_bP;
@@ -268,13 +267,11 @@
srcPtr += srcPitch;
dstPtr += dstPitch * 2;
- deltaPtr += srcPitch;
} // while (height--)
}
}
-void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *dP;
uint16 *bP;
uint32 inc_bP;
@@ -387,13 +384,11 @@
srcPtr += srcPitch;
dstPtr += dstPitch * 2;
- deltaPtr += srcPitch;
} // endof: while (height--)
}
}
-void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height) {
+void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
uint8 *dP;
uint16 *bP;
uint32 inc_bP;
@@ -539,7 +534,6 @@
srcPtr += srcPitch;
dstPtr += dstPitch * 2;
- deltaPtr += srcPitch;
} // endof: while (height--)
}
}
@@ -585,8 +579,10 @@
return (result & redblueMask) | ((result >> 16) & greenMask);
}
-void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 * /* deltaPtr */ ,
- uint8 *dstPtr, uint32 dstPitch,
+// FIXME: Scale_2xSaI is not used anywhere; however, contrary to the _2xSaI function,
+// it seems to allow for arbitrary scale factors, not just 2x... hence I leave this in
+// for now, as that seems to be a very useful feature
+void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
uint32 dstWidth, uint32 dstHeight, int width, int height) {
uint8 *dP;
uint16 *bP;
@@ -717,7 +713,7 @@
}
}
-void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
unsigned int nextlineSrc = srcPitch / sizeof(uint16);
uint16 *p = (uint16 *)srcPtr;
@@ -750,7 +746,7 @@
}
}
-void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
while (height--) {
memcpy(dstPtr, srcPtr, 2 * width);
@@ -759,7 +755,7 @@
}
}
-void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
uint8 *r;
@@ -778,7 +774,7 @@
}
}
-void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
uint8 *r;
uint32 dstPitch2 = dstPitch * 2;
@@ -804,7 +800,7 @@
}
}
-void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
unsigned int nextlineSrc = srcPitch / sizeof(uint16);
uint16 *p = (uint16 *)srcPtr;
@@ -834,7 +830,7 @@
return c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3)));
}
-void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
+void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height)
{
unsigned int nextlineSrc = srcPitch / sizeof(uint16);
Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- scaler.h 25 Mar 2003 00:26:52 -0000 1.5
+++ scaler.h 25 Apr 2003 20:02:58 -0000 1.6
@@ -22,24 +22,20 @@
#define SCALER_H
extern int Init_2xSaI (uint32 BitFormat);
-extern void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr, uint8 *dstPtr,
- uint32 dstPitch, int width, int height);
-extern void Super2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
-extern void DotMatrix(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
- uint8 *dstPtr, uint32 dstPitch, int width, int height);
+
+#define DECLARE_SCALER(x) \
+ extern void x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, \
+ uint32 dstPitch, int width, int height)
+
+DECLARE_SCALER(_2xSaI);
+DECLARE_SCALER(Super2xSaI);
+DECLARE_SCALER(SuperEagle);
+DECLARE_SCALER(AdvMame2x);
+DECLARE_SCALER(Normal1x);
+DECLARE_SCALER(Normal2x);
+DECLARE_SCALER(Normal3x);
+DECLARE_SCALER(TV2x);
+DECLARE_SCALER(DotMatrix);
enum {
More information about the Scummvm-git-logs
mailing list