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