File: SWTri_Loop.cpp

package info (click to toggle)
libtuxcap 1.4.0.dfsg2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,176 kB
  • sloc: cpp: 43,203; ansic: 3,095; python: 774; objc: 242; makefile: 100; xml: 87
file content (57 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// This file is included by SWTri.cpp and should not be built directly by the project.

	int64_t	subTex = x0 - lx;
	unsigned int	u, v, r, g, b, a;

	#if defined(MOD_ARGB)
		a = la + static_cast<int>((da * subTex)>>16);
		r = lr + static_cast<int>((dr * subTex)>>16);
		g = lg + static_cast<int>((dg * subTex)>>16);
		b = lb + static_cast<int>((db * subTex)>>16);
	#endif
	
	#if defined(TEXTURED)
		u = lu + static_cast<int>((du * subTex)>>16);
		v = lv + static_cast<int>((dv * subTex)>>16);
	#endif
	
	PTYPE *		pix = fb + (x0>>16);
	int		width = ((x1-x0)>>16);
	
	while(width-- > 0)
	{
		#include PIXEL_INCLUDE
//		if (bit_format == 0x888) PIXEL888()
//		if (bit_format == 0x565) PIXEL565()
//		if (bit_format == 0x555) PIXEL555()
//		if (bit_format == 0x8888) PIXEL8888()
		++pix;
		#if defined(MOD_ARGB)
			a += da;
			r += dr;
			g += dg;
			b += db;
		#endif
		
		#if defined(TEXTURED)
			u += du;
			v += dv;
		#endif
	}
	
	lx += ldx;
	sx += sdx;
	fb += pitch;

	#if defined (MOD_ARGB)
		la += lda;
		lr += ldr;
		lg += ldg;
		lb += ldb;
	#endif
		
	#if defined (TEXTURED)	
		lu += ldu;
		lv += ldv;
	#endif