Go to most recent revision | Details | 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 | |||
7 | je .e_sw_1 |
||
8 | cmp dword[eax+offs_cont_render_mode],GL_SELECT |
||
9 | jne .def_1 |
||
10 | cmp dword[eax+offs_cont_select_overflow],0 |
||
11 | je @f |
||
12 | sub ebx,[eax+offs_cont_select_hits] |
||
13 | jmp .else_e |
||
14 | @@: |
||
15 | mov ebx,[eax+offs_cont_select_hits] |
||
16 | .else_e: |
||
17 | mov dword[eax+offs_cont_select_overflow],0 |
||
18 | mov ecx,[eax+offs_cont_select_buffer] |
||
19 | mov dword[eax+offs_cont_select_ptr],ecx |
||
20 | mov dword[eax+offs_cont_name_stack_size],0 |
||
21 | jmp .e_sw_1 |
||
22 | .def_1: |
||
23 | ; assert(0); |
||
24 | .e_sw_1: |
||
25 | cmp dword[mode],GL_RENDER |
||
26 | jne @f |
||
27 | mov dword[eax+offs_cont_render_mode],GL_RENDER |
||
28 | jmp .e_sw_2 |
||
29 | @@: |
||
30 | cmp dword[mode],GL_SELECT |
||
31 | jne .def_2 |
||
32 | mov dword[eax+offs_cont_render_mode],GL_SELECT |
||
33 | ; assert( c->select_buffer != NULL); |
||
34 | mov ecx,[eax+offs_cont_select_buffer] |
||
35 | mov dword[eax+offs_cont_select_ptr],ecx |
||
36 | mov dword[eax+offs_cont_select_hits],0 |
||
37 | mov dword[eax+offs_cont_select_overflow],0 |
||
38 | mov dword[eax+offs_cont_select_hit],0 ;NULL |
||
39 | jmp .e_sw_2 |
||
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+offs_cont_select_buffer],ebx |
||
55 | mov ebx,[size] |
||
56 | mov dword[eax+offs_cont_select_size],ebx |
||
57 | ret |
||
58 | endp |
||
59 | |||
60 | |||
61 | proc glopInitNames uses eax, context:dword, p:dword |
||
62 | mov eax,[context] |
||
63 | cmp dword[eax+offs_cont_render_mode],GL_SELECT |
||
64 | jne @f |
||
65 | mov dword[eax+offs_cont_name_stack_size],0 |
||
66 | mov dword[eax+offs_cont_select_hit],0 ;=NULL |
||
67 | @@: |
||
68 | ret |
||
69 | endp |
||
70 | |||
71 | |||
72 | proc glopPushName uses eax ebx, context:dword, p:dword |
||
73 | mov eax,[context] |
||
74 | cmp dword[eax+offs_cont_render_mode],GL_SELECT |
||
75 | jne @f |
||
76 | ; assert(c->name_stack_size |
||
77 | mov dword[eax+offs_cont_select_hit],0 ;=NULL |
||
78 | inc dword[eax+offs_cont_name_stack_size] |
||
79 | mov ebx,dword[eax+offs_cont_name_stack_size] |
||
80 | shl ebx,2 |
||
81 | add ebx,eax |
||
82 | mov eax,[p] |
||
83 | mov eax,[eax+4] |
||
84 | mov dword[ebx+offs_cont_name_stack],eax ;context.name_stack[context.name_stack_size++]=p[1] |
||
85 | @@: |
||
86 | ret |
||
87 | endp |
||
88 | |||
89 | |||
90 | proc glopPopName uses eax, context:dword, p:dword |
||
91 | mov eax,[context] |
||
92 | cmp dword[eax+offs_cont_render_mode],GL_SELECT |
||
93 | jne @f |
||
94 | ; assert(c->name_stack_size>0); |
||
95 | dec dword[eax+offs_cont_name_stack_size] |
||
96 | mov dword[eax+offs_cont_select_hit],0 ;=NULL |
||
97 | @@: |
||
98 | ret |
||
99 | endp |
||
100 | |||
101 | |||
102 | proc glopLoadName uses eax ebx, context:dword, p:dword |
||
103 | mov eax,[context] |
||
104 | cmp dword[eax+offs_cont_render_mode],GL_SELECT |
||
105 | jne @f |
||
106 | ; assert(c->name_stack_size>0); |
||
107 | mov dword[eax+offs_cont_select_hit],0 ;=NULL |
||
108 | mov ebx,dword[eax+offs_cont_name_stack_size] |
||
109 | dec ebx |
||
110 | shl ebx,2 |
||
111 | add ebx,eax |
||
112 | mov eax,[p] |
||
113 | mov eax,[eax+4] |
||
114 | mov dword[ebx+offs_cont_name_stack],eax ;context.name_stack[context.name_stack_size-1]=p[1] |
||
115 | @@: |
||
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 | |||
126 | jne .end_f ;if (!context.select_overflow) |
||
127 | cmp dword[eax+offs_cont_select_hit],0 ;if (context.select_hit==NULL) |
||
128 | jne .els_0 |
||
129 | mov ecx,[eax+offs_cont_name_stack_size] |
||
130 | mov ebx,[eax+offs_cont_select_ptr] |
||
131 | sub ebx,[eax+offs_cont_select_buffer] |
||
132 | sub ebx,3 |
||
133 | sub ebx,ecx |
||
134 | cmp ebx,[eax+offs_cont_select_size] |
||
135 | jle .els_1 |
||
136 | mov dword[eax+offs_cont_select_overflow],1 |
||
137 | jmp .end_f |
||
138 | .els_1: |
||
139 | mov ebx,[eax+offs_cont_select_ptr] |
||
140 | mov [eax+offs_cont_select_hit],ebx |
||
141 | mov edx,[eax+offs_cont_name_stack_size] |
||
142 | mov [ebx],edx |
||
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;i |
||
151 | mov [eax+offs_cont_select_ptr],ebx |
||
152 | inc dword[eax+offs_cont_select_hits] |
||
153 | jmp .end_f |
||
154 | .els_0: |
||
155 | mov ebx,[zmin] |
||
156 | cmp dword[eax+offs_cont_select_hit+4],ebx |
||
157 | jle @f |
||
158 | mov dword[eax+offs_cont_select_hit+4],ebx |
||
159 | @@: |
||
160 | mov ebx,[zmax] |
||
161 | cmp dword[eax+offs_cont_select_hit+8],ebx |
||
162 | jge .end_f |
||
163 | mov dword[eax+offs_cont_select_hit+8],ebx |
||
164 | .end_f: |
||
165 | ret |
||
166 | endp |
||
167 | > |
||
168 |