Subversion Repositories Kolibri OS

Rev

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

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