Subversion Repositories Kolibri OS

Rev

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

Rev 303 Rev 595
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,0x73000000
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
	mov	eax, 8
-
 
201
	mov	bx, word [mainwnd_pos.w]
-
 
202
	sub	bx, 25
-
 
203
	shl	ebx, 16
-
 
204
	add	ebx, 12
-
 
205
 
-
 
206
	mov	ecx, 3 * 65536 + 12
-
 
207
	mov	edx, 177
-
 
208
	mov	esi, 0x00bcbec6
-
 
209
	int	0x40
-
 
210
 
-
 
211
	;mov     eax, 4
-
 
212
	shr	eax, 1
-
 
213
	sub	ebx, -4 * 65536
-
 
214
	mov	bx, 6
-
 
215
	mov	ecx, 0
-
 
216
	mov	edx, cross
-
 
217
	mov	esi, 1
-
 
218
	int	0x40
-
 
219
 
200
	ret
220
	ret
-
 
221
 
-
 
222
cross:
-
 
223
	db	'X'
201
endf
224
endf
202
 
225
 
203
;-----------------------------------------------------------------------------
226
;-----------------------------------------------------------------------------
204
func draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
227
func draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
205
;-----------------------------------------------------------------------------
228
;-----------------------------------------------------------------------------
206
	cmp	[do_not_draw],1  ; return if drawing is not permitted
229
	cmp	[do_not_draw],1  ; return if drawing is not permitted
207
	jae	.exit
230
	jae	.exit
208
	pusha
231
	pusha
209
 
232
 
210
	mov	ecx,[p_info.client_box.height-2]
233
	mov	ecx,[p_info.client_box.height-2]
211
	mov	cx,word[p_info.client_box.height]
234
	mov	cx,word[p_info.client_box.height]
212
	sub	ecx,STATH*65536+STATH
235
	sub	ecx,STATH*65536+STATH
213
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
236
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
214
 
237
 
215
;       mcall   9,p_info,-1
238
;       mcall   9,p_info,-1
216
 
239
 
217
	mov	ecx,[p_info.client_box.height-2]
240
	mov	ecx,[p_info.client_box.height-2]
218
	mov	cx,word[p_info.client_box.height]
241
	mov	cx,word[p_info.client_box.height]
219
	sub	ecx,STATH*65536
242
	sub	ecx,STATH*65536
220
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
243
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
221
 
244
 
222
	pushad
245
	pushad
223
	add	ecx,1*65536
246
	add	ecx,1*65536
224
	mov	cx,STATH
247
	mov	cx,STATH
225
	mcall	13,<0,6*13>,,[cl_3d_normal]
248
	mcall	13,<0,6*13>,,[cl_3d_normal]
226
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
249
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
227
	mov	ebx,(6*(s_modified.size+15)+1)*65536
250
	mov	ebx,(6*(s_modified.size+15)+1)*65536
228
	mov	bx,word[p_info.client_box.width]
251
	mov	bx,word[p_info.client_box.width]
229
	sub	bx,6*(s_modified.size+15)
252
	sub	bx,6*(s_modified.size+15)
230
	mcall
253
	mcall
231
	popad
254
	popad
232
 
255
 
233
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
256
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
234
	mcall
257
	mcall
235
 
258
 
236
	and	ecx,0x0000FFFF
259
	and	ecx,0x0000FFFF
237
	push	ecx
260
	push	ecx
238
 
261
 
239
	mov	eax,[cur_editor.Caret.Y]
262
	mov	eax,[cur_editor.Caret.Y]
240
	inc	eax
263
	inc	eax
241
	mov	ecx,10
264
	mov	ecx,10
242
	mov	edi,p_info+0x100
265
	mov	edi,p_info+0x100
243
	cld
266
	cld
244
	call	uint2str
267
	call	uint2str
245
	mov	al,','
268
	mov	al,','
246
	stosb
269
	stosb
247
	mov	eax,[cur_editor.Caret.X]
270
	mov	eax,[cur_editor.Caret.X]
248
	inc	eax
271
	inc	eax
249
	call	uint2str
272
	call	uint2str
250
 
273
 
251
	pop	ebx
274
	pop	ebx
252
 
275
 
253
	lea	esi,[edi-p_info-0x100]
276
	lea	esi,[edi-p_info-0x100]
254
	lea	edi,[esi*3]
277
	lea	edi,[esi*3]
255
	shl	edi,16
278
	shl	edi,16
256
 
279
 
257
	add	ebx,(1+6*6+3)*65536-STATH/2-3
280
	add	ebx,(1+6*6+3)*65536-STATH/2-3
258
	sub	ebx,edi
281
	sub	ebx,edi
259
	mcall	4,,[sc.work_text],p_info+0x100
282
	mcall	4,,[sc.work_text],p_info+0x100
260
 
283
 
261
	cmp	[cur_editor.Modified],0
284
	cmp	[cur_editor.Modified],0
262
	je	@f
285
	je	@f
263
	and	ebx,0x0000FFFF
286
	and	ebx,0x0000FFFF
264
	add	ebx,(1+12*6+12+1)*65536
287
	add	ebx,(1+12*6+12+1)*65536
265
	mcall	,,,s_modified,s_modified.size
288
	mcall	,,,s_modified,s_modified.size
266
 
289
 
267
    @@: cmp	[s_status],0
290
    @@: cmp	[s_status],0
268
	je	@f
291
	je	@f
269
	and	ebx,0x0000FFFF
292
	and	ebx,0x0000FFFF
270
	add	ebx,6*(s_modified.size+16)*65536
293
	add	ebx,6*(s_modified.size+16)*65536
271
	or	ecx, 80000000h
294
	or	ecx, 80000000h
272
	mcall	,,,[s_status]
295
	mcall	,,,[s_status]
273
 
296
 
274
    @@: popa
297
    @@: popa
275
 
298
 
276
  .exit:
299
  .exit:
277
	ret
300
	ret
278
endf
301
endf
279
 
302
 
280
func draw_fillrect ; ebx,ecx,edx
303
func draw_fillrect ; ebx,ecx,edx
281
	; ebx = 
304
	; ebx = 
282
	; ecx = 
305
	; ecx = 
283
	push	ebx ecx edx
306
	push	ebx ecx edx
284
	call	draw_framerect
307
	call	draw_framerect
285
	add	ebx,1*65536-2
308
	add	ebx,1*65536-2
286
	add	ecx,1*65536-2
309
	add	ecx,1*65536-2
287
	mcall	13,,,esi
310
	mcall	13,,,esi
288
	pop	edx ecx ebx
311
	pop	edx ecx ebx
289
	ret
312
	ret
290
endf
313
endf
291
 
314
 
292
func draw_framerect ; ebx,ecx,edx
315
func draw_framerect ; ebx,ecx,edx
293
	; ebx = 
316
	; ebx = 
294
	; ecx = 
317
	; ecx = 
295
	push	ebx ecx
318
	push	ebx ecx
296
 
319
 
297
	add	bx,[esp+6]	 ; ebx = 
320
	add	bx,[esp+6]	 ; ebx = 
298
	mov	cx,[esp+2]	 ; ecx = 
321
	mov	cx,[esp+2]	 ; ecx = 
299
	dec	ebx
322
	dec	ebx
300
	mcall	38
323
	mcall	38
301
	add	cx,[esp]	 ; ecx = 
324
	add	cx,[esp]	 ; ecx = 
302
	rol	ecx,16
325
	rol	ecx,16
303
	add	cx,[esp]	 ; ecx = 
326
	add	cx,[esp]	 ; ecx = 
304
	sub	ecx,0x00010001
327
	sub	ecx,0x00010001
305
	mcall
328
	mcall
306
 
329
 
307
	mov	ebx,[esp+4]	 ; ebx = 
330
	mov	ebx,[esp+4]	 ; ebx = 
308
	mov	ecx,[esp]	 ; ecx = 
331
	mov	ecx,[esp]	 ; ecx = 
309
	mov	bx,[esp+6]	 ; ebx = 
332
	mov	bx,[esp+6]	 ; ebx = 
310
	add	cx,[esp+2]
333
	add	cx,[esp+2]
311
	dec	ecx
334
	dec	ecx
312
	mcall
335
	mcall
313
	add	bx,[esp+4]
336
	add	bx,[esp+4]
314
	rol	ebx,16
337
	rol	ebx,16
315
	add	bx,[esp+4]
338
	add	bx,[esp+4]
316
	sub	ebx,0x00010001
339
	sub	ebx,0x00010001
317
	mcall
340
	mcall
318
 
341
 
319
	pop	ecx ebx
342
	pop	ecx ebx
320
	ret
343
	ret
321
endf
344
endf
322
 
345
 
323
func draw_check
346
func draw_check
324
	push	bx
347
	push	bx
325
	shl	ebx,16
348
	shl	ebx,16
326
	pop	bx
349
	pop	bx
327
	add	ebx,0x00010000
350
	add	ebx,0x00010000
328
	push	cx
351
	push	cx
329
	shl	ecx,16
352
	shl	ecx,16
330
	pop	cx
353
	pop	cx
331
	add	ecx,0x00020001
354
	add	ecx,0x00020001
332
	mcall	38
355
	mcall	38
333
	add	ecx,0x00010001
356
	add	ecx,0x00010001
334
	mcall
357
	mcall
335
	add	ebx,4
358
	add	ebx,4
336
	sub	ecx,2
359
	sub	ecx,2
337
	mcall
360
	mcall
338
	sub	ecx,0x00010001
361
	sub	ecx,0x00010001
339
	mcall
362
	mcall
340
	ret
363
	ret
341
endf
364
endf
342
 
365
 
343
func calc_middle
366
func calc_middle
344
	shr	eax,1
367
	shr	eax,1
345
	shr	ebx,1
368
	shr	ebx,1
346
	and	eax,0x007F7F7F
369
	and	eax,0x007F7F7F
347
	and	ebx,0x007F7F7F
370
	and	ebx,0x007F7F7F
348
	add	eax,ebx
371
	add	eax,ebx
349
	ret
372
	ret
350
endf
373
endf
351
 
374
 
352
func calc_3d_colors
375
func calc_3d_colors
353
	pushad
376
	pushad
354
	m2m	[cl_3d_normal],[sc.work]
377
	m2m	[cl_3d_normal],[sc.work]
355
	m2m	[cl_3d_inset],[sc.work_graph]
378
	m2m	[cl_3d_inset],[sc.work_graph]
356
	push	[cl_3d_normal]
379
	push	[cl_3d_normal]
357
	add	byte[esp],48
380
	add	byte[esp],48
358
	jnc	@f
381
	jnc	@f
359
	mov	byte[esp],255
382
	mov	byte[esp],255
360
    @@: add	byte[esp+1],48
383
    @@: add	byte[esp+1],48
361
	jnc	@f
384
	jnc	@f
362
	mov	byte[esp+1],255
385
	mov	byte[esp+1],255
363
    @@: add	byte[esp+2],48
386
    @@: add	byte[esp+2],48
364
	jnc	@f
387
	jnc	@f
365
	mov	byte[esp+2],255
388
	mov	byte[esp+2],255
366
    @@: pop	[cl_3d_outset]
389
    @@: pop	[cl_3d_outset]
367
	mov	eax,[cl_3d_inset]
390
	mov	eax,[cl_3d_inset]
368
	mov	ebx,[cl_3d_outset]
391
	mov	ebx,[cl_3d_outset]
369
	call	calc_middle
392
	call	calc_middle
370
	mov	ebx,[cl_3d_normal]
393
	mov	ebx,[cl_3d_normal]
371
	call	calc_middle
394
	call	calc_middle
372
	mov	[cl_3d_pushed],eax
395
	mov	[cl_3d_pushed],eax
373
	mov	eax,[cl_3d_normal]
396
	mov	eax,[cl_3d_normal]
374
	mov	ebx,[sc.work_text]
397
	mov	ebx,[sc.work_text]
375
	call	calc_middle
398
	call	calc_middle
376
	mov	[cl_3d_grayed],eax
399
	mov	[cl_3d_grayed],eax
377
	popad
400
	popad
378
	ret
401
	ret
379
endf
402
endf
380
 
403
 
381
func draw_3d_panel ; x,y,w,h
404
func draw_3d_panel ; x,y,w,h
382
	push	eax ebx ecx edx
405
	push	eax ebx ecx edx
383
	cmp	dword[esp+16+8],4
406
	cmp	dword[esp+16+8],4
384
	jl	.exit
407
	jl	.exit
385
	cmp	dword[esp+16+4],4
408
	cmp	dword[esp+16+4],4
386
	jl	.exit
409
	jl	.exit
387
	mov	ebx,[esp+16+16-2]
410
	mov	ebx,[esp+16+16-2]
388
	mov	bx,[esp+16+8]
411
	mov	bx,[esp+16+8]
389
	inc	ebx
412
	inc	ebx
390
	mov	ecx,[esp+16+12-2]
413
	mov	ecx,[esp+16+12-2]
391
	mov	cx,[esp+16+4]
414
	mov	cx,[esp+16+4]
392
	inc	ecx
415
	inc	ecx
393
	mcall	13,,,[cl_3d_normal]
416
	mcall	13,,,[cl_3d_normal]
394
	dec	ebx
417
	dec	ebx
395
	add	bx,[esp+16+16]
418
	add	bx,[esp+16+16]
396
	mov	cx,[esp+16+12]
419
	mov	cx,[esp+16+12]
397
	mcall	38,,,[cl_3d_inset]
420
	mcall	38,,,[cl_3d_inset]
398
	add	ecx,[esp+16+4-2]
421
	add	ecx,[esp+16+4-2]
399
	add	cx,[esp+16+4]
422
	add	cx,[esp+16+4]
400
	mcall
423
	mcall
401
	mov	bx,[esp+16+16]
424
	mov	bx,[esp+16+16]
402
	mov	ecx,[esp+16+12-2]
425
	mov	ecx,[esp+16+12-2]
403
	mov	cx,[esp+16+4]
426
	mov	cx,[esp+16+4]
404
	add	cx,[esp+16+12]
427
	add	cx,[esp+16+12]
405
	mcall
428
	mcall
406
	add	ebx,[esp+16+8-2]
429
	add	ebx,[esp+16+8-2]
407
	add	bx,[esp+16+8]
430
	add	bx,[esp+16+8]
408
	mcall
431
	mcall
409
	mov	ebx,[esp+16+16-2]
432
	mov	ebx,[esp+16+16-2]
410
	mov	bx,[esp+16+8]
433
	mov	bx,[esp+16+8]
411
	add	bx,[esp+16+16]
434
	add	bx,[esp+16+16]
412
	add	ebx,1*65536-1
435
	add	ebx,1*65536-1
413
	mov	ecx,[esp+16+12-2]
436
	mov	ecx,[esp+16+12-2]
414
	mov	cx,[esp+16+12]
437
	mov	cx,[esp+16+12]
415
	add	ecx,0x00010001
438
	add	ecx,0x00010001
416
	mcall	,,,[cl_3d_outset]
439
	mcall	,,,[cl_3d_outset]
417
	mov	bx,[esp+16+16]
440
	mov	bx,[esp+16+16]
418
	inc	ebx
441
	inc	ebx
419
	mov	ecx,[esp+16+12-2]
442
	mov	ecx,[esp+16+12-2]
420
	mov	cx,[esp+16+4]
443
	mov	cx,[esp+16+4]
421
	add	cx,[esp+16+12]
444
	add	cx,[esp+16+12]
422
	add	ecx,2*65536-1
445
	add	ecx,2*65536-1
423
	mcall
446
	mcall
424
  .exit:
447
  .exit:
425
	pop	edx ecx ebx eax
448
	pop	edx ecx ebx eax
426
	ret	4*4
449
	ret	4*4
427
endf
450
endf