Rev 5256 | Rev 6523 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5153 | IgorA | 1 | |
2 | proc glopViewport uses eax ebx ecx edx, context:dword, p:dword |
||
3 | locals |
||
4 | xsize dd ? ;int |
||
5 | ysize dd ? ;int |
||
6 | xmin dd ? ;int |
||
7 | ymin dd ? ;int |
||
8 | xsize_req dd ? ;int |
||
9 | ysize_req dd ? ;int |
||
10 | endl |
||
11 | mov edx,[context] |
||
12 | mov ebx,[p] |
||
13 | |||
14 | |||
15 | mov [xmin],ecx |
||
16 | mov ecx,[ebx+8] |
||
17 | mov [ymin],ecx |
||
18 | mov ecx,[ebx+12] |
||
19 | mov [xsize],ecx |
||
20 | mov ecx,[ebx+16] |
||
21 | mov [ysize],ecx |
||
22 | |||
23 | |||
24 | |||
25 | |||
26 | jne @f |
||
27 | mov ecx,[xmin] |
||
28 | cmp dword[edx+offs_cont_viewport+offs_vpor_xmin],ecx |
||
29 | jne @f |
||
30 | mov ecx,[ymin] |
||
31 | cmp dword[edx+offs_cont_viewport+offs_vpor_ymin],ecx |
||
32 | jne @f |
||
33 | mov ecx,[xsize] |
||
34 | cmp dword[edx+offs_cont_viewport+offs_vpor_xsize],ecx |
||
35 | jne @f |
||
36 | jmp .end_f |
||
37 | @@: |
||
38 | |||
39 | |||
40 | add ecx,[xsize] |
||
41 | mov [xsize_req],ecx ;xsize_req = xmin + xsize |
||
42 | mov ecx,[ymin] |
||
43 | add ecx,[ysize] |
||
44 | mov [ysize_req],ecx ;ysize_req = ymin + ysize |
||
45 | |||
46 | |||
47 | je @f |
||
48 | mov eax,ebp |
||
49 | sub eax,4 |
||
50 | push eax |
||
51 | sub eax,4 |
||
52 | push eax |
||
53 | stdcall dword[edx+offs_cont_gl_resize_viewport], edx ;gl_resize_viewport(context,&xsize_req,&ysize_req) |
||
54 | cmp eax,0 |
||
55 | je @f |
||
56 | stdcall dbg_print,sz_glViewport,err_4 |
||
6108 | IgorA | 57 | @@: |
5153 | IgorA | 58 | |
59 | |||
60 | sub ecx,[xmin] |
||
61 | mov [xsize],ecx |
||
62 | mov ecx,[ysize_req] |
||
63 | sub ecx,[ymin] |
||
64 | mov [ysize],ecx |
||
65 | cmp ecx,0 |
||
66 | jg @f |
||
67 | cmp dword[xsize],0 |
||
68 | jg @f |
||
69 | stdcall dbg_print,sz_glViewport,err_5 |
||
6108 | IgorA | 70 | @@: |
5153 | IgorA | 71 | mov ecx,[xmin] |
72 | mov dword[edx+offs_cont_viewport+offs_vpor_xmin],ecx |
||
73 | mov ecx,[ymin] |
||
74 | mov dword[edx+offs_cont_viewport+offs_vpor_ymin],ecx |
||
75 | mov ecx,[xsize] |
||
76 | mov dword[edx+offs_cont_viewport+offs_vpor_xsize],ecx |
||
77 | mov ecx,[ysize] |
||
78 | mov dword[edx+offs_cont_viewport+offs_vpor_ysize],ecx |
||
79 | |||
80 | |||
81 | .end_f: |
||
82 | ret |
||
83 | endp |
||
84 | |||
85 | |||
86 | proc glopEnableDisable uses eax ebx ecx, context:dword, p:dword |
||
87 | mov eax,[context] |
||
88 | mov ebx,[p] |
||
89 | mov ecx,[ebx+8] |
||
90 | mov ebx,[ebx+4] |
||
91 | |||
92 | |||
93 | jne @f |
||
94 | mov [eax+offs_cont_cull_face_enabled],ecx |
||
95 | jmp .end_f |
||
96 | @@: |
||
97 | cmp ebx,GL_LIGHTING |
||
98 | jne @f |
||
99 | mov [eax+offs_cont_lighting_enabled],ecx |
||
100 | jmp .end_f |
||
101 | @@: |
||
102 | cmp ebx,GL_COLOR_MATERIAL |
||
103 | jne @f |
||
104 | mov [eax+offs_cont_color_material_enabled],ecx |
||
105 | jmp .end_f |
||
106 | @@: |
||
107 | cmp ebx,GL_TEXTURE_2D |
||
108 | jne @f |
||
109 | mov [eax+offs_cont_texture_2d_enabled],ecx |
||
110 | jmp .end_f |
||
111 | @@: |
||
112 | cmp ebx,GL_NORMALIZE |
||
113 | jne @f |
||
114 | mov [eax+offs_cont_normalize_enabled],ecx |
||
115 | jmp .end_f |
||
116 | @@: |
||
117 | cmp ebx,GL_DEPTH_TEST |
||
118 | jne @f |
||
119 | mov [eax+offs_cont_depth_test],ecx |
||
120 | jmp .end_f |
||
121 | @@: |
||
122 | cmp ebx,GL_POLYGON_OFFSET_FILL |
||
123 | jne .polygon_offset_fill |
||
124 | cmp ecx,0 |
||
125 | je @f |
||
126 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_FILL |
||
127 | jmp .end_f |
||
128 | @@: |
||
129 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_FILL |
||
130 | jmp .end_f |
||
131 | .polygon_offset_fill: |
||
132 | cmp ebx,GL_POLYGON_OFFSET_POINT |
||
133 | jne .polygon_offset_point |
||
134 | cmp ecx,0 |
||
135 | je @f |
||
136 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_POINT |
||
137 | jmp .end_f |
||
138 | @@: |
||
139 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_POINT |
||
140 | jmp .end_f |
||
141 | .polygon_offset_point: |
||
142 | cmp ebx,GL_POLYGON_OFFSET_LINE |
||
143 | jne .polygon_offset_line |
||
144 | cmp ecx,0 |
||
145 | je @f |
||
146 | or dword[eax+offs_cont_offset_states],TGL_OFFSET_LINE |
||
147 | jmp .end_f |
||
148 | @@: |
||
149 | and dword[eax+offs_cont_offset_states],not TGL_OFFSET_LINE |
||
150 | jmp .end_f |
||
151 | .polygon_offset_line: ;default: |
||
152 | cmp ebx,GL_LIGHT0 |
||
5256 | IgorA | 153 | jl .els_0 |
154 | cmp ebx,GL_LIGHT0+MAX_LIGHTS |
||
155 | jge .els_0 ;if (GL_LIGHT0 <= ebx < GL_LIGHT0+MAX_LIGHTS) |
||
156 | sub ebx,GL_LIGHT0 |
||
157 | stdcall gl_enable_disable_light, eax,ebx,ecx |
||
158 | jmp .end_f |
||
159 | .els_0: |
||
160 | ;//fprintf(stderr,"glEnableDisable: 0x%X not supported.\n",code); |
||
5153 | IgorA | 161 | .end_f: |
162 | ret |
||
163 | endp |
||
164 | |||
165 | |||
166 | proc glopShadeModel uses eax ebx, context:dword,p:dword |
||
167 | mov eax,[context] |
||
168 | mov ebx,[p] |
||
169 | mov ebx,[ebx+4] |
||
170 | mov [eax+offs_cont_current_shade_model],ebx |
||
171 | ret |
||
172 | endp |
||
173 | |||
174 | |||
175 | proc glopCullFace uses eax ebx, context:dword,p:dword |
||
176 | mov eax,[context] |
||
177 | mov ebx,[p] |
||
178 | mov ebx,[ebx+4] |
||
179 | mov [eax+offs_cont_current_cull_face],ebx |
||
180 | ret |
||
181 | endp |
||
182 | |||
183 | |||
184 | proc glopFrontFace uses eax ebx, context:dword,p:dword |
||
185 | mov eax,[context] |
||
186 | mov ebx,[p] |
||
187 | mov ebx,[ebx+4] |
||
188 | mov [eax+offs_cont_current_front_face],ebx |
||
189 | ret |
||
190 | endp |
||
191 | |||
192 | |||
193 | proc glopPolygonMode uses eax ebx, context:dword,p:dword |
||
194 | mov eax,[context] |
||
195 | mov ebx,[p] |
||
196 | |||
197 | |||
198 | jne @f |
||
199 | mov ebx,[ebx+8] |
||
200 | mov [eax+offs_cont_polygon_mode_back],ebx |
||
201 | jmp .end_f |
||
202 | @@: |
||
203 | cmp dword[ebx+4],GL_FRONT |
||
204 | jne @f |
||
205 | mov ebx,[ebx+8] |
||
206 | mov [eax+offs_cont_polygon_mode_front],ebx |
||
207 | jmp .end_f |
||
208 | @@: |
||
209 | cmp dword[ebx+4],GL_FRONT_AND_BACK |
||
210 | jne @f |
||
211 | mov ebx,[ebx+8] |
||
212 | mov [eax+offs_cont_polygon_mode_front],ebx |
||
213 | mov [eax+offs_cont_polygon_mode_back],ebx |
||
214 | jmp .end_f |
||
215 | @@: |
||
216 | ; assert(0); |
||
217 | .end_f: |
||
218 | ret |
||
219 | endp |
||
220 | |||
221 | |||
222 | proc glopHint, context:dword,p:dword |
||
223 | if 0 |
||
224 | ; int target=p[1].i; |
||
225 | ; int mode=p[2].i; |
||
226 | |||
227 | |||
228 | end if |
||
229 | ret |
||
230 | endp |
||
231 | |||
232 | |||
233 | proc glopPolygonOffset uses eax ebx ecx, context:dword,p:dword |
||
234 | mov eax,[context] |
||
235 | mov ebx,[p] |
||
236 | mov ecx,[ebx+4] |
||
237 | mov [eax+offs_cont_offset_factor],ecx |
||
238 | mov ecx,[ebx+8] |
||
239 | mov [eax+offs_cont_offset_units],ecx |
||
240 | ret |
||
241 | endp>=> |
||
242 |