Subversion Repositories Kolibri OS

Rev

Rev 297 | Rev 595 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 297 Rev 303
1
;-----------------------------------------------------------------------------
1
;-----------------------------------------------------------------------------
2
func drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
2
func drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
3
;-----------------------------------------------------------------------------
3
;-----------------------------------------------------------------------------
4
 
4
 
5
	cmp	[just_from_popup],1
5
	cmp	[just_from_popup],1
6
	jne	@f
6
	jne	@f
7
	ret
7
	ret
8
    @@:
8
    @@:
9
 
9
 
10
	mcall	48,3,sc,sizeof.system_colors
10
	mcall	48,3,sc,sizeof.system_colors
11
	call	calc_3d_colors
11
	call	calc_3d_colors
12
 
12
 
13
	mcall	12,1
13
	mcall	12,1
14
 
14
 
15
	m2m	[sc.work],dword[color_tbl.back]
15
	m2m	[sc.work],dword[color_tbl.back]
16
 
16
 
17
	mov	edx,[sc.work]
17
	mov	edx,[sc.work]
18
	add	edx,0x33000000
18
	add	edx,0x73000000
19
	mov	ebx,[mainwnd_pos.x-2]
19
	mov	ebx,[mainwnd_pos.x-2]
20
	mov	bx,word[mainwnd_pos.w]
20
	mov	bx,word[mainwnd_pos.w]
21
	mov	ecx,[mainwnd_pos.y-2]
21
	mov	ecx,[mainwnd_pos.y-2]
22
	mov	cx,word[mainwnd_pos.h]
22
	mov	cx,word[mainwnd_pos.h]
23
	mcall	0,,,,,s_title
23
	mcall	0,,,,,s_title
24
 
24
 
25
	mcall	9,p_info,-1
25
	mcall	9,p_info,-1
26
	mov	esi,p_info.box.left
26
	mov	esi,p_info.box.left
27
	mov	edi,mainwnd_pos
27
	mov	edi,mainwnd_pos
28
	mov	ecx,4
28
	mov	ecx,4
29
	cld
29
	cld
30
	rep	movsd
30
	rep	movsd
31
 
31
 
32
	cmp	[p_info.client_box.height],LINEH
32
	cmp	[p_info.client_box.height],LINEH
33
	jl	.exit.2
33
	jl	.exit.2
34
 
34
 
35
	mov	[tab_bar.Bounds.Left],0
35
	mov	[tab_bar.Bounds.Left],0
36
	mov	[tab_bar.Bounds.Top],ATOPH
36
	mov	[tab_bar.Bounds.Top],ATOPH
37
	mov	eax,[p_info.client_box.width]
37
	mov	eax,[p_info.client_box.width]
38
	mov	[tab_bar.Bounds.Right],eax
38
	mov	[tab_bar.Bounds.Right],eax
39
	mov	eax,[p_info.client_box.height]
39
	mov	eax,[p_info.client_box.height]
40
	sub	eax,[bot_dlg_height]
40
	sub	eax,[bot_dlg_height]
41
	add	eax,-STATH-1
41
	add	eax,-STATH-1
42
	mov	[tab_bar.Bounds.Bottom],eax
42
	mov	[tab_bar.Bounds.Bottom],eax
43
 
43
 
44
	call	align_editor_in_tab
44
	call	align_editor_in_tab
45
 
45
 
46
	mov	[top_ofs],ATOPH;+1
46
	mov	[top_ofs],ATOPH;+1
47
 
47
 
48
	mov	eax,[p_info.client_box.height]
48
	mov	eax,[p_info.client_box.height]
49
	add	eax,-STATH+1;*3-2-2
49
	add	eax,-STATH+1;*3-2-2
50
	sub	eax,[bot_dlg_height]
50
	sub	eax,[bot_dlg_height]
51
	mov	[bot_ofs],eax
51
	mov	[bot_ofs],eax
52
 
52
 
53
	call	draw_bottom_dialog
53
	call	draw_bottom_dialog
54
 
54
 
55
;        mov     [do_not_draw],1 ; do_not_draw = true
55
;        mov     [do_not_draw],1 ; do_not_draw = true
56
 
56
 
57
;        mov     ebx,eax
57
;        mov     ebx,eax
58
;        sub     ebx,[top_ofs]
58
;        sub     ebx,[top_ofs]
59
;        sub     ebx,SCRLW*3+AMINS+5
59
;        sub     ebx,SCRLW*3+AMINS+5
60
;        js      .no_draw
60
;        js      .no_draw
61
 
61
 
62
;        dec     [do_not_draw]    ; do_not_draw = false
62
;        dec     [do_not_draw]    ; do_not_draw = false
63
;        sub     eax,SCRLW+3
63
;        sub     eax,SCRLW+3
64
;        sub     eax,[top_ofs]
64
;        sub     eax,[top_ofs]
65
;        cdq
65
;        cdq
66
;        mov     ebx,LINEH
66
;        mov     ebx,LINEH
67
;        div     ebx
67
;        div     ebx
68
;        mov     [lines.scr],eax
68
;        mov     [lines.scr],eax
69
 
69
 
70
	inc	[top_ofs]
70
	inc	[top_ofs]
71
 
71
 
72
	call	draw_main_menu
72
	call	draw_main_menu
73
 
73
 
74
	jmp	.exit
74
	jmp	.exit
75
 
75
 
76
  .no_draw:
76
  .no_draw:
77
	mov	[top_ofs],2
77
	mov	[top_ofs],2
78
	mov	eax,[p_info.client_box.height]
78
	mov	eax,[p_info.client_box.height]
79
	inc	eax
79
	inc	eax
80
	mov	[bot_ofs],eax
80
	mov	[bot_ofs],eax
81
	sub	eax,2
81
	sub	eax,2
82
	push	eax
82
	push	eax
83
	add	eax,-2-SCRLW
83
	add	eax,-2-SCRLW
84
	cdq
84
	cdq
85
	mov	ebx,LINEH
85
	mov	ebx,LINEH
86
	idiv	ebx
86
	idiv	ebx
87
	mov	[lines.scr],eax
87
	mov	[lines.scr],eax
88
	pop	eax
88
	pop	eax
89
 
89
 
90
	mov	ebx,[p_info.client_box.height]
90
	mov	ebx,[p_info.client_box.height]
91
	sub	ebx,SCRLW*3+AMINS+2
91
	sub	ebx,SCRLW*3+AMINS+2
92
	jns	@f
92
	jns	@f
93
 
93
 
94
	inc	[do_not_draw]
94
	inc	[do_not_draw]
95
 
95
 
96
	dec	eax
96
	dec	eax
97
	cdq
97
	cdq
98
	mov	ebx,LINEH
98
	mov	ebx,LINEH
99
	idiv	ebx
99
	idiv	ebx
100
	mov	[lines.scr],eax
100
	mov	[lines.scr],eax
101
 
101
 
102
	mov	eax,[p_info.client_box.width]
102
	mov	eax,[p_info.client_box.width]
103
	cdq
103
	cdq
104
	mov	ebx,6
104
	mov	ebx,6
105
	idiv	ebx
105
	idiv	ebx
106
	mov	[columns.scr],eax
106
	mov	[columns.scr],eax
107
    @@:
107
    @@:
108
 
108
 
109
  .exit:
109
  .exit:
110
	call	draw_editor
110
	call	draw_editor
111
	call	draw_tabctl
111
	call	draw_tabctl
112
  .exit.2:
112
  .exit.2:
113
	mcall	12,2
113
	mcall	12,2
114
	ret
114
	ret
115
endf
115
endf
116
 
116
 
117
;-----------------------------------------------------------------------------
117
;-----------------------------------------------------------------------------
118
func draw_bottom_dialog ;/////////////////////////////////////////////////////
118
func draw_bottom_dialog ;/////////////////////////////////////////////////////
119
;-----------------------------------------------------------------------------
119
;-----------------------------------------------------------------------------
120
	cmp	[bot_dlg_height],0
120
	cmp	[bot_dlg_height],0
121
	je	.exit
121
	je	.exit
122
	pushad
122
	pushad
123
	mov	ebx,[p_info.client_box.width]
123
	mov	ebx,[p_info.client_box.width]
124
	mov	ecx,[bot_ofs]
124
	mov	ecx,[bot_ofs]
125
	dec	ecx
125
	dec	ecx
126
	push	cx
126
	push	cx
127
	shl	ecx,16
127
	shl	ecx,16
128
	pop	cx
128
	pop	cx
129
	mcall	38,,,[cl_3d_inset]
129
	mcall	38,,,[cl_3d_inset]
130
	mov	ecx,[bot_ofs-2]
130
	mov	ecx,[bot_ofs-2]
131
	mov	cx,word[bot_dlg_height]
131
	mov	cx,word[bot_dlg_height]
132
	dec	ecx
132
	dec	ecx
133
	mov	ebx,[p_info.client_box.width]
133
	mov	ebx,[p_info.client_box.width]
134
	inc	ebx
134
	inc	ebx
135
	mcall	13,,,[cl_3d_normal]
135
	mcall	13,,,[cl_3d_normal]
136
	mov	al,1
136
	mov	al,1
137
	call	[bot_dlg_handler]
137
	call	[bot_dlg_handler]
138
	popad
138
	popad
139
 
139
 
140
  .exit:
140
  .exit:
141
	ret
141
	ret
142
endf
142
endf
143
 
143
 
144
mi_sel	 dd ?
144
mi_sel	 dd ?
145
mi_cur	 dd -1
145
mi_cur	 dd -1
146
 
146
 
147
;-----------------------------------------------------------------------------
147
;-----------------------------------------------------------------------------
148
func draw_main_menu ;/////////////////////////////////////////////////////////
148
func draw_main_menu ;/////////////////////////////////////////////////////////
149
;-----------------------------------------------------------------------------
149
;-----------------------------------------------------------------------------
150
	mov	ebx,[p_info.client_box.width]
150
	mov	ebx,[p_info.client_box.width]
151
	inc	ebx
151
	inc	ebx
152
	mcall	13,,ATOPH-1,[cl_3d_normal]
152
	mcall	13,,ATOPH-1,[cl_3d_normal]
153
 
153
 
154
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
154
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
155
 
155
 
156
	mov	edx,main_menu
156
	mov	edx,main_menu
157
	mov	ebx,9*65536+ATOPH/2-3;4
157
	mov	ebx,9*65536+ATOPH/2-3;4
158
	mov	[mi_sel],0
158
	mov	[mi_sel],0
159
	mov	edi,[mi_cur]
159
	mov	edi,[mi_cur]
160
    @@: inc	[mi_sel]
160
    @@: inc	[mi_sel]
161
	cmp	[mi_sel],main_menu.cnt_item
161
	cmp	[mi_sel],main_menu.cnt_item
162
	ja	.exit
162
	ja	.exit
163
	mov	ecx,[sc.work_text]
163
	mov	ecx,[sc.work_text]
164
	cmp	edi,[mi_sel]
164
	cmp	edi,[mi_sel]
165
	jne	.lp1
165
	jne	.lp1
166
	pushad
166
	pushad
167
	push	edx
167
	push	edx
168
	mov	ecx,[edx+4]
168
	mov	ecx,[edx+4]
169
	add	ecx,2*65536-2
169
	add	ecx,2*65536-2
170
	mcall	13,[edx+0],,[sc.work]
170
	mcall	13,[edx+0],,[sc.work]
171
	mov	edx,[esp]
171
	mov	edx,[esp]
172
	mov	cx,[edx+6]
172
	mov	cx,[edx+6]
173
	add	ecx,-1*65536+1
173
	add	ecx,-1*65536+1
174
	add	bx,[edx+2]
174
	add	bx,[edx+2]
175
	mcall	38,,,[cl_3d_inset]
175
	mcall	38,,,[cl_3d_inset]
176
 
176
 
177
	mov	edx,[esp]
177
	mov	edx,[esp]
178
	add	cx,[edx+4]
178
	add	cx,[edx+4]
179
	add	cx,-2
179
	add	cx,-2
180
	mov	bx,[edx+2]
180
	mov	bx,[edx+2]
181
	mcall	,,,[cl_3d_inset]
181
	mcall	,,,[cl_3d_inset]
182
	pop	edx
182
	pop	edx
183
	movzx	eax,word[edx]
183
	movzx	eax,word[edx]
184
	add	ebx,eax
184
	add	ebx,eax
185
	shl	eax,16
185
	shl	eax,16
186
	add	ebx,eax
186
	add	ebx,eax
187
	mcall	38,,,[cl_3d_inset]
187
	mcall	38,,,[cl_3d_inset]
188
	popad
188
	popad
189
	mov	ecx,[color_tbl.text]
189
	mov	ecx,[color_tbl.text]
190
  .lp1: add	edx,8+1
190
  .lp1: add	edx,8+1
191
	movzx	esi,byte[edx-1]
191
	movzx	esi,byte[edx-1]
192
	mcall	4
192
	mcall	4
193
	add	edx,esi
193
	add	edx,esi
194
	add	esi,2
194
	add	esi,2
195
	imul	esi,6*65536
195
	imul	esi,6*65536
196
	add	ebx,esi
196
	add	ebx,esi
197
	jmp	@b
197
	jmp	@b
198
 
198
 
199
  .exit:
199
  .exit:
200
	ret
200
	ret
201
endf
201
endf
202
 
202
 
203
;-----------------------------------------------------------------------------
203
;-----------------------------------------------------------------------------
204
func draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
204
func draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
205
;-----------------------------------------------------------------------------
205
;-----------------------------------------------------------------------------
206
	cmp	[do_not_draw],1  ; return if drawing is not permitted
206
	cmp	[do_not_draw],1  ; return if drawing is not permitted
207
	jae	.exit
207
	jae	.exit
208
	pusha
208
	pusha
209
 
209
 
210
	mov	ecx,[p_info.client_box.height-2]
210
	mov	ecx,[p_info.client_box.height-2]
211
	mov	cx,word[p_info.client_box.height]
211
	mov	cx,word[p_info.client_box.height]
212
	sub	ecx,STATH*65536+STATH
212
	sub	ecx,STATH*65536+STATH
213
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
213
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
214
 
214
 
215
;       mcall   9,p_info,-1
215
;       mcall   9,p_info,-1
216
 
216
 
217
	mov	ecx,[p_info.client_box.height-2]
217
	mov	ecx,[p_info.client_box.height-2]
218
	mov	cx,word[p_info.client_box.height]
218
	mov	cx,word[p_info.client_box.height]
219
	sub	ecx,STATH*65536
219
	sub	ecx,STATH*65536
220
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
220
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
221
 
221
 
222
	pushad
222
	pushad
223
	add	ecx,1*65536
223
	add	ecx,1*65536
224
	mov	cx,STATH
224
	mov	cx,STATH
225
	mcall	13,<0,6*13>,,[cl_3d_normal]
225
	mcall	13,<0,6*13>,,[cl_3d_normal]
226
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
226
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
227
	mov	ebx,(6*(s_modified.size+15)+1)*65536
227
	mov	ebx,(6*(s_modified.size+15)+1)*65536
228
	mov	bx,word[p_info.client_box.width]
228
	mov	bx,word[p_info.client_box.width]
229
	sub	bx,6*(s_modified.size+15)
229
	sub	bx,6*(s_modified.size+15)
230
	mcall
230
	mcall
231
	popad
231
	popad
232
 
232
 
233
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
233
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
234
	mcall
234
	mcall
235
 
235
 
236
	and	ecx,0x0000FFFF
236
	and	ecx,0x0000FFFF
237
	push	ecx
237
	push	ecx
238
 
238
 
239
	mov	eax,[cur_editor.Caret.Y]
239
	mov	eax,[cur_editor.Caret.Y]
240
	inc	eax
240
	inc	eax
241
	mov	ecx,10
241
	mov	ecx,10
242
	mov	edi,p_info+0x100
242
	mov	edi,p_info+0x100
243
	cld
243
	cld
244
	call	uint2str
244
	call	uint2str
245
	mov	al,','
245
	mov	al,','
246
	stosb
246
	stosb
247
	mov	eax,[cur_editor.Caret.X]
247
	mov	eax,[cur_editor.Caret.X]
248
	inc	eax
248
	inc	eax
249
	call	uint2str
249
	call	uint2str
250
 
250
 
251
	pop	ebx
251
	pop	ebx
252
 
252
 
253
	lea	esi,[edi-p_info-0x100]
253
	lea	esi,[edi-p_info-0x100]
254
	lea	edi,[esi*3]
254
	lea	edi,[esi*3]
255
	shl	edi,16
255
	shl	edi,16
256
 
256
 
257
	add	ebx,(1+6*6+3)*65536-STATH/2-3
257
	add	ebx,(1+6*6+3)*65536-STATH/2-3
258
	sub	ebx,edi
258
	sub	ebx,edi
259
	mcall	4,,[sc.work_text],p_info+0x100
259
	mcall	4,,[sc.work_text],p_info+0x100
260
 
260
 
261
	cmp	[cur_editor.Modified],0
261
	cmp	[cur_editor.Modified],0
262
	je	@f
262
	je	@f
263
	and	ebx,0x0000FFFF
263
	and	ebx,0x0000FFFF
264
	add	ebx,(1+12*6+12+1)*65536
264
	add	ebx,(1+12*6+12+1)*65536
265
	mcall	,,,s_modified,s_modified.size
265
	mcall	,,,s_modified,s_modified.size
266
 
266
 
267
    @@: cmp	[s_status],0
267
    @@: cmp	[s_status],0
268
	je	@f
268
	je	@f
269
	and	ebx,0x0000FFFF
269
	and	ebx,0x0000FFFF
270
	add	ebx,6*(s_modified.size+16)*65536
270
	add	ebx,6*(s_modified.size+16)*65536
271
	or	ecx, 80000000h
271
	or	ecx, 80000000h
272
	mcall	,,,[s_status]
272
	mcall	,,,[s_status]
273
 
273
 
274
    @@: popa
274
    @@: popa
275
 
275
 
276
  .exit:
276
  .exit:
277
	ret
277
	ret
278
endf
278
endf
279
 
279
 
280
func draw_fillrect ; ebx,ecx,edx
280
func draw_fillrect ; ebx,ecx,edx
281
	; ebx = 
281
	; ebx = 
282
	; ecx = 
282
	; ecx = 
283
	push	ebx ecx edx
283
	push	ebx ecx edx
284
	call	draw_framerect
284
	call	draw_framerect
285
	add	ebx,1*65536-2
285
	add	ebx,1*65536-2
286
	add	ecx,1*65536-2
286
	add	ecx,1*65536-2
287
	mcall	13,,,esi
287
	mcall	13,,,esi
288
	pop	edx ecx ebx
288
	pop	edx ecx ebx
289
	ret
289
	ret
290
endf
290
endf
291
 
291
 
292
func draw_framerect ; ebx,ecx,edx
292
func draw_framerect ; ebx,ecx,edx
293
	; ebx = 
293
	; ebx = 
294
	; ecx = 
294
	; ecx = 
295
	push	ebx ecx
295
	push	ebx ecx
296
 
296
 
297
	add	bx,[esp+6]	 ; ebx = 
297
	add	bx,[esp+6]	 ; ebx = 
298
	mov	cx,[esp+2]	 ; ecx = 
298
	mov	cx,[esp+2]	 ; ecx = 
299
	dec	ebx
299
	dec	ebx
300
	mcall	38
300
	mcall	38
301
	add	cx,[esp]	 ; ecx = 
301
	add	cx,[esp]	 ; ecx = 
302
	rol	ecx,16
302
	rol	ecx,16
303
	add	cx,[esp]	 ; ecx = 
303
	add	cx,[esp]	 ; ecx = 
304
	sub	ecx,0x00010001
304
	sub	ecx,0x00010001
305
	mcall
305
	mcall
306
 
306
 
307
	mov	ebx,[esp+4]	 ; ebx = 
307
	mov	ebx,[esp+4]	 ; ebx = 
308
	mov	ecx,[esp]	 ; ecx = 
308
	mov	ecx,[esp]	 ; ecx = 
309
	mov	bx,[esp+6]	 ; ebx = 
309
	mov	bx,[esp+6]	 ; ebx = 
310
	add	cx,[esp+2]
310
	add	cx,[esp+2]
311
	dec	ecx
311
	dec	ecx
312
	mcall
312
	mcall
313
	add	bx,[esp+4]
313
	add	bx,[esp+4]
314
	rol	ebx,16
314
	rol	ebx,16
315
	add	bx,[esp+4]
315
	add	bx,[esp+4]
316
	sub	ebx,0x00010001
316
	sub	ebx,0x00010001
317
	mcall
317
	mcall
318
 
318
 
319
	pop	ecx ebx
319
	pop	ecx ebx
320
	ret
320
	ret
321
endf
321
endf
322
 
322
 
323
func draw_check
323
func draw_check
324
	push	bx
324
	push	bx
325
	shl	ebx,16
325
	shl	ebx,16
326
	pop	bx
326
	pop	bx
327
	add	ebx,0x00010000
327
	add	ebx,0x00010000
328
	push	cx
328
	push	cx
329
	shl	ecx,16
329
	shl	ecx,16
330
	pop	cx
330
	pop	cx
331
	add	ecx,0x00020001
331
	add	ecx,0x00020001
332
	mcall	38
332
	mcall	38
333
	add	ecx,0x00010001
333
	add	ecx,0x00010001
334
	mcall
334
	mcall
335
	add	ebx,4
335
	add	ebx,4
336
	sub	ecx,2
336
	sub	ecx,2
337
	mcall
337
	mcall
338
	sub	ecx,0x00010001
338
	sub	ecx,0x00010001
339
	mcall
339
	mcall
340
	ret
340
	ret
341
endf
341
endf
342
 
342
 
343
func calc_middle
343
func calc_middle
344
	shr	eax,1
344
	shr	eax,1
345
	shr	ebx,1
345
	shr	ebx,1
346
	and	eax,0x007F7F7F
346
	and	eax,0x007F7F7F
347
	and	ebx,0x007F7F7F
347
	and	ebx,0x007F7F7F
348
	add	eax,ebx
348
	add	eax,ebx
349
	ret
349
	ret
350
endf
350
endf
351
 
351
 
352
func calc_3d_colors
352
func calc_3d_colors
353
	pushad
353
	pushad
354
	m2m	[cl_3d_normal],[sc.work]
354
	m2m	[cl_3d_normal],[sc.work]
355
	m2m	[cl_3d_inset],[sc.work_graph]
355
	m2m	[cl_3d_inset],[sc.work_graph]
356
	push	[cl_3d_normal]
356
	push	[cl_3d_normal]
357
	add	byte[esp],48
357
	add	byte[esp],48
358
	jnc	@f
358
	jnc	@f
359
	mov	byte[esp],255
359
	mov	byte[esp],255
360
    @@: add	byte[esp+1],48
360
    @@: add	byte[esp+1],48
361
	jnc	@f
361
	jnc	@f
362
	mov	byte[esp+1],255
362
	mov	byte[esp+1],255
363
    @@: add	byte[esp+2],48
363
    @@: add	byte[esp+2],48
364
	jnc	@f
364
	jnc	@f
365
	mov	byte[esp+2],255
365
	mov	byte[esp+2],255
366
    @@: pop	[cl_3d_outset]
366
    @@: pop	[cl_3d_outset]
367
	mov	eax,[cl_3d_inset]
367
	mov	eax,[cl_3d_inset]
368
	mov	ebx,[cl_3d_outset]
368
	mov	ebx,[cl_3d_outset]
369
	call	calc_middle
369
	call	calc_middle
370
	mov	ebx,[cl_3d_normal]
370
	mov	ebx,[cl_3d_normal]
371
	call	calc_middle
371
	call	calc_middle
372
	mov	[cl_3d_pushed],eax
372
	mov	[cl_3d_pushed],eax
373
	mov	eax,[cl_3d_normal]
373
	mov	eax,[cl_3d_normal]
374
	mov	ebx,[sc.work_text]
374
	mov	ebx,[sc.work_text]
375
	call	calc_middle
375
	call	calc_middle
376
	mov	[cl_3d_grayed],eax
376
	mov	[cl_3d_grayed],eax
377
	popad
377
	popad
378
	ret
378
	ret
379
endf
379
endf
380
 
380
 
381
func draw_3d_panel ; x,y,w,h
381
func draw_3d_panel ; x,y,w,h
382
	push	eax ebx ecx edx
382
	push	eax ebx ecx edx
383
	cmp	dword[esp+16+8],4
383
	cmp	dword[esp+16+8],4
384
	jl	.exit
384
	jl	.exit
385
	cmp	dword[esp+16+4],4
385
	cmp	dword[esp+16+4],4
386
	jl	.exit
386
	jl	.exit
387
	mov	ebx,[esp+16+16-2]
387
	mov	ebx,[esp+16+16-2]
388
	mov	bx,[esp+16+8]
388
	mov	bx,[esp+16+8]
389
	inc	ebx
389
	inc	ebx
390
	mov	ecx,[esp+16+12-2]
390
	mov	ecx,[esp+16+12-2]
391
	mov	cx,[esp+16+4]
391
	mov	cx,[esp+16+4]
392
	inc	ecx
392
	inc	ecx
393
	mcall	13,,,[cl_3d_normal]
393
	mcall	13,,,[cl_3d_normal]
394
	dec	ebx
394
	dec	ebx
395
	add	bx,[esp+16+16]
395
	add	bx,[esp+16+16]
396
	mov	cx,[esp+16+12]
396
	mov	cx,[esp+16+12]
397
	mcall	38,,,[cl_3d_inset]
397
	mcall	38,,,[cl_3d_inset]
398
	add	ecx,[esp+16+4-2]
398
	add	ecx,[esp+16+4-2]
399
	add	cx,[esp+16+4]
399
	add	cx,[esp+16+4]
400
	mcall
400
	mcall
401
	mov	bx,[esp+16+16]
401
	mov	bx,[esp+16+16]
402
	mov	ecx,[esp+16+12-2]
402
	mov	ecx,[esp+16+12-2]
403
	mov	cx,[esp+16+4]
403
	mov	cx,[esp+16+4]
404
	add	cx,[esp+16+12]
404
	add	cx,[esp+16+12]
405
	mcall
405
	mcall
406
	add	ebx,[esp+16+8-2]
406
	add	ebx,[esp+16+8-2]
407
	add	bx,[esp+16+8]
407
	add	bx,[esp+16+8]
408
	mcall
408
	mcall
409
	mov	ebx,[esp+16+16-2]
409
	mov	ebx,[esp+16+16-2]
410
	mov	bx,[esp+16+8]
410
	mov	bx,[esp+16+8]
411
	add	bx,[esp+16+16]
411
	add	bx,[esp+16+16]
412
	add	ebx,1*65536-1
412
	add	ebx,1*65536-1
413
	mov	ecx,[esp+16+12-2]
413
	mov	ecx,[esp+16+12-2]
414
	mov	cx,[esp+16+12]
414
	mov	cx,[esp+16+12]
415
	add	ecx,0x00010001
415
	add	ecx,0x00010001
416
	mcall	,,,[cl_3d_outset]
416
	mcall	,,,[cl_3d_outset]
417
	mov	bx,[esp+16+16]
417
	mov	bx,[esp+16+16]
418
	inc	ebx
418
	inc	ebx
419
	mov	ecx,[esp+16+12-2]
419
	mov	ecx,[esp+16+12-2]
420
	mov	cx,[esp+16+4]
420
	mov	cx,[esp+16+4]
421
	add	cx,[esp+16+12]
421
	add	cx,[esp+16+12]
422
	add	ecx,2*65536-1
422
	add	ecx,2*65536-1
423
	mcall
423
	mcall
424
  .exit:
424
  .exit:
425
	pop	edx ecx ebx eax
425
	pop	edx ecx ebx eax
426
	ret	4*4
426
	ret	4*4
427
endf
427
endf