Subversion Repositories Kolibri OS

Rev

Rev 5218 | Rev 8069 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5218 Rev 6243
Line 6... Line 6...
6
 
6
 
Line 7... Line 7...
7
ZB_Z_BITS equ 16
7
ZB_Z_BITS equ 16
Line 8... Line -...
8
 
-
 
9
ZB_POINT_Z_FRAC_BITS equ 14
8
 
10
 
-
 
11
ZB_POINT_S_MIN equ (1 shl 13)
9
ZB_POINT_Z_FRAC_BITS equ 14
Line 12... Line 10...
12
ZB_POINT_S_MAX equ ( (1 shl 22)-(1 shl 13) )
10
 
13
ZB_POINT_T_MIN equ (1 shl 21)
11
ZB_POINT_TEXEL_SIZE equ 12 ;точность множителя для вычисления координат текселя
14
ZB_POINT_T_MAX equ ( (1 shl 30)-(1 shl 21) )
12
	;влияет на максимальный размер текстуры
15
 
13
 
Line 25... Line 23...
25
ZB_MODE_INDEX  equ 2  ; color index 8 bits
23
ZB_MODE_INDEX  equ 2  ; color index 8 bits
26
ZB_MODE_RGBA   equ 3  ; 32 bit rgba mode
24
ZB_MODE_RGBA   equ 3  ; 32 bit rgba mode
27
ZB_MODE_RGB24  equ 4  ; 24 bit rgb mode
25
ZB_MODE_RGB24  equ 4  ; 24 bit rgb mode
28
ZB_NB_COLORS   equ 225 ; number of colors for 8 bit display
26
ZB_NB_COLORS   equ 225 ; number of colors for 8 bit display
Line 29... Line 27...
29
 
27
 
30
if TGL_FEATURE_RENDER_BITS eq 15
-
 
31
 
-
 
32
;#define RGB_TO_PIXEL(r,g,b) \
-
 
33
;  ((((r) >> 1) & 0x7c00) | (((g) >> 6) & 0x03e0) | ((b) >> 11))
-
 
34
;typedef unsigned short PIXEL;
-
 
35
; bytes per pixel
-
 
36
;PSZB equ 2
-
 
37
; bits per pixel = (1 << PSZH)
-
 
38
;PSZSH equ 4
-
 
39
 
-
 
40
else if TGL_FEATURE_RENDER_BITS eq 16
-
 
41
 
-
 
42
; 16 bit mode
-
 
43
;#define RGB_TO_PIXEL(r,g,b) \
-
 
44
;  (((r) & 0xF800) | (((g) >> 5) & 0x07E0) | ((b) >> 11))
-
 
45
;typedef unsigned short PIXEL;
-
 
46
;PSZB equ 2
-
 
47
;PSZSH equ 4
-
 
48
 
-
 
Line 49... Line 28...
49
else if TGL_FEATURE_RENDER_BITS eq 24
28
if TGL_FEATURE_RENDER_BITS eq 24
50
 
29
 
51
macro RGB_TO_PIXEL r,g,b
30
macro RGB_TO_PIXEL r,g,b
52
{
31
{
Line 92... Line 71...
92
    
71
    
93
	nb_colors dd ? ;int
72
	nb_colors dd ? ;int
94
	dctable dd ? ;*unsigned char
73
	dctable dd ? ;*unsigned char
95
	ctable dd ? ;*int
74
	ctable dd ? ;*int
-
 
75
	current_texture dd ? ;*PIXEL
-
 
76
	s_log2 dd ? ;unsigned int
-
 
77
	s_bound dd ? ;unsigned int
96
	current_texture dd ? ;*PIXEL
78
	t_bound dd ? ;unsigned int
Line 97... Line 79...
97
ends
79
ends
98
 
80
 
99
offs_zbuf_xsize equ 0
81
offs_zbuf_xsize equ 0
Line 105... Line 87...
105
offs_zbuf_frame_buffer_allocated equ 28
87
offs_zbuf_frame_buffer_allocated equ 28
106
offs_zbuf_nb_colors equ 32
88
offs_zbuf_nb_colors equ 32
107
offs_zbuf_dctable equ 36
89
offs_zbuf_dctable equ 36
108
offs_zbuf_ctable equ 40
90
offs_zbuf_ctable equ 40
109
offs_zbuf_current_texture equ 44
91
offs_zbuf_current_texture equ 44
-
 
92
offs_zbuf_s_log2 equ 48
-
 
93
offs_zbuf_s_bound equ 52
-
 
94
offs_zbuf_t_bound equ 56
Line 110... Line 95...
110
 
95
 
111
struct ZBufferPoint
96
struct ZBufferPoint
112
	x dd ? ;int ;integer coordinates in the zbuffer
97
	x dd ? ;int ;integer coordinates in the zbuffer
113
	y dd ? ;int
98
	y dd ? ;int