[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.64,1.65 scaler.h,1.27,1.28 system.h,1.86,1.87
Eugene Sandulenko
sev at users.sourceforge.net
Thu Feb 17 15:03:37 CET 2005
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27902/common
Modified Files:
scaler.cpp scaler.h system.h
Log Message:
Mouse part of big patch #1013937 (OSystem layer with bigger resolution)
Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- scaler.cpp 1 Jan 2005 16:08:49 -0000 1.64
+++ scaler.cpp 17 Feb 2005 23:00:57 -0000 1.65
@@ -169,6 +169,46 @@
}
}
+#define INTERPOLATE INTERPOLATE<bitFormat>
+#define Q_INTERPOLATE Q_INTERPOLATE<bitFormat>
+
+/**
+ * Trivial nearest-neighbour 1.5x scaler.
+ */
+template<int bitFormat>
+void Normal1o5xTemplate(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
+ int width, int height) {
+ uint8 *r;
+ const uint32 dstPitch2 = dstPitch * 2;
+ const uint32 dstPitch3 = dstPitch * 3;
+ const uint32 srcPitch2 = srcPitch * 2;
+
+ assert(((int)dstPtr & 1) == 0);
+ while (height) {
+ r = dstPtr;
+ for (int i = 0; i < width; i += 2, r += 6) {
+ uint16 color0 = *(((const uint16 *)srcPtr) + i);
+ uint16 color1 = *(((const uint16 *)srcPtr) + i + 1);
+ uint16 color2 = *(((const uint16 *)(srcPtr + srcPitch)) + i);
+ uint16 color3 = *(((const uint16 *)(srcPtr + srcPitch)) + i + 1);
+
+ *(uint16 *)(r + 0) = color0;
+ *(uint16 *)(r + 2) = INTERPOLATE(color0, color1);
+ *(uint16 *)(r + 4) = color1;
+ *(uint16 *)(r + 0 + dstPitch) = INTERPOLATE(color0, color2);
+ *(uint16 *)(r + 2 + dstPitch) = Q_INTERPOLATE(color0, color1, color2, color3);
+ *(uint16 *)(r + 4 + dstPitch) = INTERPOLATE(color1, color3);
+ *(uint16 *)(r + 0 + dstPitch2) = color2;
+ *(uint16 *)(r + 2 + dstPitch2) = INTERPOLATE(color2, color3);
+ *(uint16 *)(r + 4 + dstPitch2) = color3;
+ }
+ srcPtr += srcPitch2;
+ dstPtr += dstPitch3;
+ height -= 2;
+ }
+}
+MAKE_WRAPPER(Normal1o5x)
+
/**
* The Scale2x filter, also known as AdvMame2x.
* See also http://scale2x.sourceforge.net
Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- scaler.h 1 Jan 2005 16:08:50 -0000 1.27
+++ scaler.h 17 Feb 2005 23:00:58 -0000 1.28
@@ -41,6 +41,7 @@
DECLARE_SCALER(Normal1x);
DECLARE_SCALER(Normal2x);
DECLARE_SCALER(Normal3x);
+DECLARE_SCALER(Normal1o5x);
DECLARE_SCALER(TV2x);
DECLARE_SCALER(DotMatrix);
DECLARE_SCALER(HQ2x);
Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- system.h 11 Jan 2005 13:25:00 -0000 1.86
+++ system.h 17 Feb 2005 23:00:58 -0000 1.87
@@ -96,7 +96,15 @@
* Implementing this is purely optional, and no harm should arise
* when not doing so (except for decreased speed in said frontends).
*/
- kFeatureAutoComputeDirtyRects
+ kFeatureAutoComputeDirtyRects,
+
+ /**
+ * This flags determines either cursor can have its own palette or not
+ * It is currently used only by some Macintosh versions of Humongous
+ * Entertainment games. If backend doesn't implement this feature then
+ * engine switches to b/w version of cursors.
+ */
+ kFeatureCursorHasPalette
};
/**
@@ -274,6 +282,18 @@
virtual void setPalette(const byte *colors, uint start, uint num) = 0;
/**
+ * Replace the specified range of cursor the palette with new colors.
+ * The palette entries from 'start' till (start+num-1) will be replaced - so
+ * a full palette update is accomplished via start=0, num=256.
+ *
+ * Backends which implement it should have kFeatureCursorHasPalette flag set
+ *
+ * @see setPalette
+ * @see kFeatureCursorHasPalette
+ */
+ virtual void setCursorPalette(const byte *colors, uint start, uint num) {};
+
+ /**
* Blit a bitmap to the virtual screen.
* The real screen will not immediately be updated to reflect the changes.
* Client code has to to call updateScreen to ensure any changes are
@@ -365,14 +385,15 @@
/**
* Set the bitmap used for drawing the cursor.
*
- * @param buf the pixmap data to be used (8bit/pixel)
- * @param w width of the mouse cursor
- * @param h height of the mouse cursor
- * @param hotspotX horizontal offset from the left side to the hotspot
- * @param hotspotY vertical offset from the top side to the hotspot
- * @param keycolor transparency color index
+ * @param buf the pixmap data to be used (8bit/pixel)
+ * @param w width of the mouse cursor
+ * @param h height of the mouse cursor
+ * @param hotspotX horizontal offset from the left side to the hotspot
+ * @param hotspotY vertical offset from the top side to the hotspot
+ * @param keycolor transparency color index
+ * @param cursorTargetScale scale factor which cursor is designed for
*/
- virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, byte keycolor = 255, int cursorTargetScale = 1) = 0;
//@}
More information about the Scummvm-git-logs
mailing list