Subversion Repositories Kolibri OS

Rev

Rev 2065 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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