Subversion Repositories AndroidProjects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
244 chris 1
{
2
	if (mLockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount == 16)
3
	{
4
		ushort* aDestPixelsRow = ((ushort*) mLockedSurfaceDesc.lpSurface) + (theY * mLockedSurfaceDesc.lPitch/2) + theX;
5
 
6
		if (aMemoryImage->mHasTrans)
7
		{
8
			for (int y = 0; y < theSrcRect.mHeight; y++)
9
			{
10
				ushort* aDestPixels = aDestPixelsRow;
11
 
12
				aSrcPixels = aSrcPixelsRow;
13
 
14
				for (int x = 0; x < theSrcRect.mWidth; x++)
15
				{
16
					ulong aSrc = NEXT_SRC_COLOR;
17
 
18
					if (aSrc>>24 != 0)
19
						*(aDestPixels++) = (ushort) aSrc;
20
					else
21
						aDestPixels++;
22
				}
23
 
24
				aDestPixelsRow += mLockedSurfaceDesc.lPitch/2;
25
				aSrcPixelsRow += theImage->mWidth;
26
			}
27
		}
28
		else
29
		{
30
			for (int y = 0; y < theSrcRect.mHeight; y++)
31
			{
32
				ushort* aDestPixels = aDestPixelsRow;
33
 
34
				aSrcPixels = aSrcPixelsRow;
35
 
36
				for (int x = 0; x < theSrcRect.mWidth; x++)
37
				{
38
					*(aDestPixels++) = (ushort) NEXT_SRC_COLOR;
39
				}
40
 
41
				aDestPixelsRow += mLockedSurfaceDesc.lPitch/2;
42
				aSrcPixelsRow += theImage->mWidth;
43
			}
44
		}
45
	}
46
	else if (mLockedSurfaceDesc.ddpfPixelFormat.dwRGBBitCount == 32)
47
	{
48
		ulong* aDestPixelsRow = ((ulong*) mLockedSurfaceDesc.lpSurface) + (theY * mLockedSurfaceDesc.lPitch/4) + theX;
49
 
50
		if (aMemoryImage->mHasTrans)
51
		{
52
			for (int y = 0; y < theSrcRect.mHeight; y++)
53
			{
54
				ulong* aDestPixels = aDestPixelsRow;
55
 
56
				aSrcPixels = aSrcPixelsRow;
57
 
58
				for (int x = 0; x < theSrcRect.mWidth; x++)
59
				{
60
					ulong aSrc = NEXT_SRC_COLOR;
61
 
62
					if (aSrc>>24 != 0)
63
						*(aDestPixels++) = aSrc;
64
					else
65
						aDestPixels++;
66
				}
67
 
68
				aDestPixelsRow += mLockedSurfaceDesc.lPitch/4;
69
				aSrcPixelsRow += theImage->mWidth;
70
			}
71
		}
72
		else
73
		{
74
			for (int y = 0; y < theSrcRect.mHeight; y++)
75
			{
76
				ulong* aDestPixels = aDestPixelsRow;
77
 
78
				aSrcPixels = aSrcPixelsRow;
79
 
80
				for (int x = 0; x < theSrcRect.mWidth; x++)
81
				{
82
					*(aDestPixels++) = NEXT_SRC_COLOR;
83
				}
84
 
85
				aDestPixelsRow += mLockedSurfaceDesc.lPitch/4;
86
				aSrcPixelsRow += theImage->mWidth;
87
			}
88
		}
89
	}
90
 
91
	UnlockSurface();
92
}