Subversion Repositories Kolibri OS

Rev

Rev 1643 | Rev 6359 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1643 mario79 1
;----------------------------------------------------------
6357 IgorA 2
;input:
3
; eax - start X
4
; ebx - start Y
5
; ecx - size X
6
; edx - size Y
7
; esi - colos styles (1...7)
180 heavyiron 8
draw_volume_rectangle:
1643 mario79 9
	mov	[line_x],eax
10
	mov	[line_y],ebx
11
	mov	[line_size_x],ecx
12
	mov	[line_size_y],edx
13
	cmp	esi,1
14
	jne	no_volume_light_rectangle
180 heavyiron 15
 
1643 mario79 16
	mov	[color_rectangle],0xc7cbcf
17
	mov	[color_line1],0xaeabae
18
	mov	[color_line2],0xffffff
19
	mov	[color_line3],0xc7cbcf
20
	jmp	exit_colors
21
;----------------------------------------------------------
22
no_volume_light_rectangle:
23
	cmp	esi,2
24
	jne	no_pressed_rectangle
180 heavyiron 25
 
1643 mario79 26
	mov	[color_rectangle],0x666666
27
	mov	[color_line1],0xaeabae
28
	mov	[color_line2],0x666666
29
	mov	[color_line3],0x666666
30
	jmp	exit_colors
31
;----------------------------------------------------------
32
no_pressed_rectangle:
33
	cmp	esi,3
34
	jne	no_pressed_panel
180 heavyiron 35
 
1643 mario79 36
	mov	[color_rectangle],0xc7cbcf
37
	mov	[color_line1],0xaeabae
38
	mov	[color_line2],7000
39
	mov	[color_line3],0xffffff
40
	jmp	exit_colors
41
;----------------------------------------------------------
42
no_pressed_panel:
43
	cmp	esi,4
44
	jne	no_pressed_light_panel
180 heavyiron 45
 
1643 mario79 46
	mov	[color_rectangle],0xffffff
47
	mov	[color_line1],0xaeabae
48
	mov	[color_line2],7000
49
	mov	[color_line3],0xffffff
50
	jmp	exit_colors
51
;----------------------------------------------------------
52
no_pressed_light_panel:
53
	cmp	esi,5
54
	jne	no_light_pressed_rectangle
180 heavyiron 55
 
1643 mario79 56
	mov	[color_rectangle],0x666666
57
	mov	[color_line1],0xaeabae
58
	mov	[color_line2],0x666666
59
	mov	[color_line3],0x666666
60
	jmp	exit_colors
61
;----------------------------------------------------------
62
no_light_pressed_rectangle:
63
	cmp	esi,6
64
	jne	no_work_rectangle
180 heavyiron 65
 
1643 mario79 66
	mov	[color_rectangle],0xc7cbcf
67
	mov	[color_line1],0xaeabae
68
	mov	[color_line2],0xc7cbcf
69
	mov	[color_line3],0xc7cbcf
70
	jmp	exit_colors
71
;----------------------------------------------------------
72
no_work_rectangle:
73
	cmp	esi,7
74
	jne	no_work_rectangle_2
180 heavyiron 75
 
1643 mario79 76
	mov	[color_rectangle],0xc7cbcf
77
	mov	[color_line1],0xc7cbcf
78
	mov	[color_line2],0xc7cbcf
79
	mov	[color_line3],0xc7cbcf
80
	jmp	exit_colors
180 heavyiron 81
;----------------------------------------------------------
1643 mario79 82
no_work_rectangle_2:
83
exit_colors:
84
;draw	rectangle
85
	mov	ebx,[line_x]
86
	mov	ecx,[line_y]
87
	shl	ebx,16
88
	shl	ecx,16
89
	add	ebx,[line_size_x]
90
	add	ecx,[line_size_y]
91
	mov	edx,[color_rectangle]
6357 IgorA 92
	mcall SF_DRAW_RECT
1643 mario79 93
;line	1
94
	mov	edx,[color_line1]
95
	mov	ebx,[line_x]
96
	mov	ecx,[line_y]
97
	shl	ebx,16
98
	shl	ecx,16
99
	add	ebx,[line_x]
100
	add	ecx,[line_y]
101
	add	ebx,[line_size_x]
102
	call	draw_line
103
;line	2
104
	mov	edx,[color_line1]
105
	mov	ebx,[line_x]
106
	mov	ecx,[line_y]
107
	shl	ebx,16
108
	shl	ecx,16
109
	add	ebx,[line_x]
110
	add	ecx,[line_y]
111
	add	ecx,[line_size_y]
112
	call	draw_line
113
;line	3
114
	mov	edx,[color_line1]
115
	mov	ebx,[line_x]
116
	mov	ecx,[line_y]
117
	add	ecx,[line_size_y]
118
	shl	ebx,16
119
	shl	ecx,16
120
	add	ebx,[line_x]
121
	add	ecx,[line_y]
122
	add	ebx,[line_size_x]
123
	add	ecx,[line_size_y]
124
	call	draw_line
125
;line	4
126
	mov	edx,[color_line1]
127
	mov	ebx,[line_x]
128
	mov	ecx,[line_y]
129
	add	ebx,[line_size_x]
130
	shl	ebx,16
131
	shl	ecx,16
132
	add	ebx,[line_x]
133
	add	ecx,[line_y]
134
	add	ebx,[line_size_x]
135
	add	ecx,[line_size_y]
136
	call	draw_line
137
;light	line	1
138
	mov	edx,[color_line2]
139
	mov	ebx,[line_x]
140
	mov	ecx,[line_y]
141
	inc	ebx
142
	inc	ecx
143
	shl	ebx,16
144
	shl	ecx,16
145
	add	ebx,[line_x]
146
	add	ecx,[line_y]
147
	add	ebx,[line_size_x]
148
	dec	ebx
149
	inc	ecx
150
	call	draw_line
151
;light	line	2
152
	mov	edx,[color_line2]
153
	mov	ebx,[line_x]
154
	mov	ecx,[line_y]
155
	inc	ebx
156
	inc	ecx
157
	shl	ebx,16
158
	shl	ecx,16
159
	add	ebx,[line_x]
160
	add	ecx,[line_y]
161
	add	ecx,[line_size_y]
162
	dec	ecx
163
	inc	ebx
164
	call	draw_line
165
;light	line	3
166
	mov	edx,[color_line3]
167
	mov	ebx,[line_x]
168
	mov	ecx,[line_y]
169
	add	ebx,[line_size_x]
170
	dec	ebx
171
	inc	ecx
172
	shl	ebx,16
173
	shl	ecx,16
174
	add	ebx,[line_x]
175
	add	ecx,[line_y]
176
	add	ebx,[line_size_x]
177
	add	ecx,[line_size_y]
178
	dec	ebx
179
	dec	ecx
180
	call	draw_line
181
;light	line	4
182
	mov	edx,[color_line3]
183
	mov	ebx,[line_x]
184
	mov	ecx,[line_y]
185
	add	ecx,[line_size_y]
186
	inc	ebx
187
	dec	ecx
188
	shl	ebx,16
189
	shl	ecx,16
190
	add	ebx,[line_x]
191
	add	ecx,[line_y]
192
	add	ecx,[line_size_y]
193
	add	ebx,[line_size_x]
194
	dec	ecx
195
	dec	ebx
196
	call	draw_line
197
	ret
198
;----------------------------------------------------------
180 heavyiron 199
rectangle:
1643 mario79 200
no_light_rectangle:
201
	mov	[line_x],eax
202
	mov	[line_y],ebx
203
	mov	[line_size_x],ecx
204
	mov	[line_size_y],edx
205
	mov	edx,esi
206
	mov	ebx,[line_x]
207
	mov	ecx,[line_y]
208
	shl	ebx,16
209
	shl	ecx,16
210
	add	ebx,[line_size_x]
211
	add	ecx,[line_size_y]
6357 IgorA 212
	mcall SF_DRAW_RECT
1643 mario79 213
	ret
180 heavyiron 214
;----------------------------------------------------------
215
draw_conture:
1643 mario79 216
	mov	[line_x],eax
217
	mov	[line_y],ebx
218
	mov	[line_size_x],ecx
219
	mov	[line_size_y],edx
220
	mov	[color_line1],0xaeabae
221
;line	1
222
	mov	edx,[color_line1]
223
	mov	ebx,[line_x]
224
	mov	ecx,[line_y]
225
	shl	ebx,16
226
	shl	ecx,16
227
	add	ebx,[line_x]
228
	add	ecx,[line_y]
229
	add	ebx,[line_size_x]
230
	call	draw_line
231
;line	2
232
	mov	edx,[color_line1]
233
	mov	ebx,[line_x]
234
	mov	ecx,[line_y]
235
	shl	ebx,16
236
	shl	ecx,16
237
	add	ebx,[line_x]
238
	add	ecx,[line_y]
239
	add	ecx,[line_size_y]
240
	call	draw_line
241
;line	3
242
	mov	edx,[color_line1]
243
	mov	ebx,[line_x]
244
	mov	ecx,[line_y]
245
	add	ecx,[line_size_y]
246
	shl	ebx,16
247
	shl	ecx,16
248
	add	ebx,[line_x]
249
	add	ecx,[line_y]
250
	add	ebx,[line_size_x]
251
	add	ecx,[line_size_y]
252
	call	draw_line
253
;line	4
254
	mov	edx,[color_line1]
255
	mov	ebx,[line_x]
256
	mov	ecx,[line_y]
257
	add	ebx,[line_size_x]
258
	shl	ebx,16
259
	shl	ecx,16
260
	add	ebx,[line_x]
261
	add	ecx,[line_y]
262
	add	ebx,[line_size_x]
263
	add	ecx,[line_size_y]
264
	call	draw_line
265
	ret
180 heavyiron 266
;----------------------------------------------------------
267
columnus:
1643 mario79 268
	sub	eax,ecx
269
	jns	no_columnus
270
	neg	eax
271
	cmp	eax,esi
272
	ja	no_columnus
273
	sub	ebx,edx
274
	jns	no_columnus
275
	neg	ebx
276
	cmp	ebx,edi
277
	ja	no_columnus
278
	mov	eax,1
279
	jmp	columnus_true
280
no_columnus:
281
	xor	eax,eax
282
columnus_true:
283
	ret
180 heavyiron 284
;----------------------------------------------------------
285
print_text:
1643 mario79 286
	mov	[text_x],eax
287
	mov	[text_y],ebx
288
	mov	ebx,[text_x]
289
	shl	ebx,16
290
	add	ebx,[text_y]
6357 IgorA 291
	mcall SF_DRAW_TEXT
1643 mario79 292
	ret
180 heavyiron 293
;----------------------------------------------------------
294
draw_line:
6357 IgorA 295
	mcall SF_DRAW_LINE
1643 mario79 296
	ret
180 heavyiron 297
;----------------------------------------------------------
298
;lightlin 12508927
1643 mario79 299
;lines 5669590
300
;workpan 9350879
180 heavyiron 301
;btnpress 9089258
1643 mario79 302
line_x		dd	0
303
line_y		dd	0
304
line_size_x	dd	0
305
line_size_y	dd	0
306
color_line1	dd	0
307
color_line2	dd	0
308
color_line3	dd	0
309
color_rectangle	dd	0
180 heavyiron 310
;--------------------
1643 mario79 311
text_x		dd	0
312
text_y		dd	0
180 heavyiron 313
;--------------------