Subversion Repositories Kolibri OS

Rev

Rev 5153 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5153 IgorA 1
 
2
proc glRenderMode uses ebx ecx, mode:dword
3
	call gl_get_context
4
	xor ebx,ebx
5
6
 
6523 IgorA 7
	je .e_sw_1
5153 IgorA 8
	cmp dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 9
	jne .def_1
5153 IgorA 10
		cmp dword[eax+GLContext.select_overflow],0
6523 IgorA 11
		je @f
5153 IgorA 12
			sub ebx,[eax+GLContext.select_hits]
6523 IgorA 13
			jmp .else_e
5153 IgorA 14
		@@:
15
			mov ebx,[eax+GLContext.select_hits]
6523 IgorA 16
		.else_e:
5153 IgorA 17
			mov dword[eax+GLContext.select_overflow],0
6523 IgorA 18
			mov ecx,[eax+GLContext.select_buffer]
19
			mov dword[eax+GLContext.select_ptr],ecx
20
			mov dword[eax+GLContext.name_stack_size],0
21
		jmp .e_sw_1
5153 IgorA 22
	.def_1:
23
;    assert(0);
24
	.e_sw_1:
25
	cmp dword[mode],GL_RENDER
26
	jne @f
27
		mov dword[eax+GLContext.render_mode],GL_RENDER
6523 IgorA 28
		jmp .e_sw_2
5153 IgorA 29
	@@:
30
	cmp dword[mode],GL_SELECT
31
	jne .def_2
32
		mov dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 33
;    assert( c->select_buffer != NULL);
5153 IgorA 34
		mov ecx,[eax+GLContext.select_buffer]
6523 IgorA 35
		mov dword[eax+GLContext.select_ptr],ecx
36
		mov dword[eax+GLContext.select_hits],0
37
		mov dword[eax+GLContext.select_overflow],0
38
		mov dword[eax+GLContext.select_hit],0 ;NULL
39
		jmp .e_sw_2
5153 IgorA 40
	.def_2:
41
;    assert(0);
42
	.e_sw_2:
43
	mov eax,ebx
44
	ret
45
endp
46
47
 
48
proc glSelectBuffer uses eax ebx, size:dword, buf:dword
49
	call gl_get_context
50
51
 
52
53
 
54
	mov dword[eax+GLContext.select_buffer],ebx
6523 IgorA 55
	mov ebx,[size]
5153 IgorA 56
	mov dword[eax+GLContext.select_size],ebx
6523 IgorA 57
	ret
5153 IgorA 58
endp
59
60
 
61
proc glopInitNames uses eax, context:dword, p:dword
62
	mov eax,[context]
63
	cmp dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 64
	jne @f
5153 IgorA 65
		mov dword[eax+GLContext.name_stack_size],0
6523 IgorA 66
		mov dword[eax+GLContext.select_hit],0 ;=NULL
67
	@@:
5153 IgorA 68
	ret
69
endp
70
71
 
72
proc glopPushName uses eax ebx, context:dword, p:dword
73
	mov eax,[context]
74
	cmp dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 75
	jne @f
5153 IgorA 76
;    assert(c->name_stack_size
77
		mov dword[eax+GLContext.select_hit],0 ;=NULL
6523 IgorA 78
		inc dword[eax+GLContext.name_stack_size]
79
		mov ebx,dword[eax+GLContext.name_stack_size]
80
		shl ebx,2
5153 IgorA 81
		add ebx,eax
82
		mov eax,[p]
83
		mov eax,[eax+4]
84
		mov dword[ebx+GLContext.name_stack],eax ;context.name_stack[context.name_stack_size++]=p[1]
6523 IgorA 85
	@@:
5153 IgorA 86
	ret
87
endp
88
89
 
90
proc glopPopName uses eax, context:dword, p:dword
91
	mov eax,[context]
92
	cmp dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 93
	jne @f
5153 IgorA 94
;    assert(c->name_stack_size>0);
95
		dec dword[eax+GLContext.name_stack_size]
6523 IgorA 96
		mov dword[eax+GLContext.select_hit],0 ;=NULL
97
	@@:
5153 IgorA 98
	ret
99
endp
100
101
 
102
proc glopLoadName uses eax ebx, context:dword, p:dword
103
	mov eax,[context]
104
	cmp dword[eax+GLContext.render_mode],GL_SELECT
6523 IgorA 105
	jne @f
5153 IgorA 106
;   assert(c->name_stack_size>0);
107
		mov dword[eax+GLContext.select_hit],0 ;=NULL
6523 IgorA 108
		mov ebx,dword[eax+GLContext.name_stack_size]
109
		dec ebx
5153 IgorA 110
		shl ebx,2
111
		add ebx,eax
112
		mov eax,[p]
113
		mov eax,[eax+4]
114
		mov dword[ebx+GLContext.name_stack],eax ;context.name_stack[context.name_stack_size-1]=p[1]
6523 IgorA 115
	@@:
5153 IgorA 116
	ret
117
endp
118
119
 
120
proc gl_add_select uses eax ebx ecx edx, context:dword, zmin:dword, zmax:dword
121
;  unsigned int *ptr;
122
;  int i;
123
	mov eax,[context]
124
125
 
6523 IgorA 126
	jne .end_f ;if (!context.select_overflow)
5153 IgorA 127
	cmp dword[eax+GLContext.select_hit],0 ;if (context.select_hit==NULL)
6523 IgorA 128
	jne .els_0
5153 IgorA 129
		mov ecx,[eax+GLContext.name_stack_size]
6523 IgorA 130
		mov ebx,[eax+GLContext.select_ptr]
131
		sub ebx,[eax+GLContext.select_buffer]
132
		sub ebx,3
5153 IgorA 133
		sub ebx,ecx
134
		cmp ebx,[eax+GLContext.select_size]
6523 IgorA 135
		jle .els_1
5153 IgorA 136
			mov dword[eax+GLContext.select_overflow],1
6523 IgorA 137
		jmp .end_f
5153 IgorA 138
		.els_1:
139
		mov ebx,[eax+GLContext.select_ptr]
6523 IgorA 140
		mov [eax+GLContext.select_hit],ebx
141
		mov edx,[eax+GLContext.name_stack_size]
142
		mov [ebx],edx
5153 IgorA 143
		add ebx,4
144
		mov edx,[zmin]
145
		mov [ebx],edx
146
		add ebx,4
147
		mov edx,[zmax]
148
		mov [ebx],edx
149
		add ebx,4
150
;	for(i=0;iname_stack[i];
151
		mov [eax+GLContext.select_ptr],ebx
6523 IgorA 152
		inc dword[eax+GLContext.select_hits]
153
		jmp .end_f
5153 IgorA 154
	.els_0:
155
		mov ebx,[zmin]
156
		cmp dword[eax+GLContext.select_hit+4],ebx
6523 IgorA 157
		jle @f
5153 IgorA 158
			mov dword[eax+GLContext.select_hit+4],ebx
6523 IgorA 159
		@@:
5153 IgorA 160
		mov ebx,[zmax]
161
		cmp dword[eax+GLContext.select_hit+8],ebx
6523 IgorA 162
		jge .end_f
5153 IgorA 163
			mov dword[eax+GLContext.select_hit+8],ebx
6523 IgorA 164
	.end_f:
5153 IgorA 165
	ret
166
endp
167
>
168