Subversion Repositories Kolibri OS

Rev

Rev 6359 | 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
 
6359 IgorA 16
	;mov esi,dword[syscolors+20]
17
	mov	[color_rectangle],0xc7cbcf ;esi
1643 mario79 18
	mov	[color_line1],0xaeabae
19
	mov	[color_line2],0xffffff
6359 IgorA 20
	mov	[color_line3],0xc7cbcf ;esi
1643 mario79 21
	jmp	exit_colors
22
;----------------------------------------------------------
23
no_volume_light_rectangle:
24
	cmp	esi,2
25
	jne	no_pressed_rectangle
180 heavyiron 26
 
1643 mario79 27
	mov	[color_rectangle],0x666666
28
	mov	[color_line1],0xaeabae
29
	mov	[color_line2],0x666666
30
	mov	[color_line3],0x666666
31
	jmp	exit_colors
32
;----------------------------------------------------------
33
no_pressed_rectangle:
34
	cmp	esi,3
35
	jne	no_pressed_panel
180 heavyiron 36
 
6359 IgorA 37
	mov esi,dword[syscolors+20]
38
	mov	[color_rectangle],esi
1643 mario79 39
	mov	[color_line1],0xaeabae
40
	mov	[color_line2],7000
41
	mov	[color_line3],0xffffff
42
	jmp	exit_colors
43
;----------------------------------------------------------
44
no_pressed_panel:
45
	cmp	esi,4
46
	jne	no_pressed_light_panel
180 heavyiron 47
 
1643 mario79 48
	mov	[color_rectangle],0xffffff
49
	mov	[color_line1],0xaeabae
50
	mov	[color_line2],7000
51
	mov	[color_line3],0xffffff
52
	jmp	exit_colors
53
;----------------------------------------------------------
54
no_pressed_light_panel:
55
	cmp	esi,5
56
	jne	no_light_pressed_rectangle
180 heavyiron 57
 
1643 mario79 58
	mov	[color_rectangle],0x666666
59
	mov	[color_line1],0xaeabae
60
	mov	[color_line2],0x666666
61
	mov	[color_line3],0x666666
62
	jmp	exit_colors
63
;----------------------------------------------------------
64
no_light_pressed_rectangle:
65
	cmp	esi,6
66
	jne	no_work_rectangle
180 heavyiron 67
 
6359 IgorA 68
	mov esi,dword[syscolors+20]
69
	mov [color_rectangle],esi
1643 mario79 70
	mov	[color_line1],0xaeabae
6359 IgorA 71
	mov	[color_line2],esi
72
	mov	[color_line3],esi
1643 mario79 73
	jmp	exit_colors
74
;----------------------------------------------------------
75
no_work_rectangle:
76
	cmp	esi,7
77
	jne	no_work_rectangle_2
180 heavyiron 78
 
6359 IgorA 79
	mov esi,dword[syscolors+20]
80
	mov	[color_rectangle],esi
81
	mov	[color_line1],esi
82
	mov	[color_line2],esi
83
	mov	[color_line3],esi
1643 mario79 84
	jmp	exit_colors
180 heavyiron 85
;----------------------------------------------------------
1643 mario79 86
no_work_rectangle_2:
87
exit_colors:
88
;draw	rectangle
89
	mov	ebx,[line_x]
90
	mov	ecx,[line_y]
91
	shl	ebx,16
92
	shl	ecx,16
93
	add	ebx,[line_size_x]
94
	add	ecx,[line_size_y]
95
	mov	edx,[color_rectangle]
6357 IgorA 96
	mcall SF_DRAW_RECT
1643 mario79 97
;line	1
98
	mov	edx,[color_line1]
99
	mov	ebx,[line_x]
100
	mov	ecx,[line_y]
101
	shl	ebx,16
102
	shl	ecx,16
103
	add	ebx,[line_x]
104
	add	ecx,[line_y]
105
	add	ebx,[line_size_x]
106
	call	draw_line
107
;line	2
108
	mov	edx,[color_line1]
109
	mov	ebx,[line_x]
110
	mov	ecx,[line_y]
111
	shl	ebx,16
112
	shl	ecx,16
113
	add	ebx,[line_x]
114
	add	ecx,[line_y]
115
	add	ecx,[line_size_y]
116
	call	draw_line
117
;line	3
118
	mov	edx,[color_line1]
119
	mov	ebx,[line_x]
120
	mov	ecx,[line_y]
121
	add	ecx,[line_size_y]
122
	shl	ebx,16
123
	shl	ecx,16
124
	add	ebx,[line_x]
125
	add	ecx,[line_y]
126
	add	ebx,[line_size_x]
127
	add	ecx,[line_size_y]
128
	call	draw_line
129
;line	4
130
	mov	edx,[color_line1]
131
	mov	ebx,[line_x]
132
	mov	ecx,[line_y]
133
	add	ebx,[line_size_x]
134
	shl	ebx,16
135
	shl	ecx,16
136
	add	ebx,[line_x]
137
	add	ecx,[line_y]
138
	add	ebx,[line_size_x]
139
	add	ecx,[line_size_y]
140
	call	draw_line
141
;light	line	1
142
	mov	edx,[color_line2]
143
	mov	ebx,[line_x]
144
	mov	ecx,[line_y]
145
	inc	ebx
146
	inc	ecx
147
	shl	ebx,16
148
	shl	ecx,16
149
	add	ebx,[line_x]
150
	add	ecx,[line_y]
151
	add	ebx,[line_size_x]
152
	dec	ebx
153
	inc	ecx
154
	call	draw_line
155
;light	line	2
156
	mov	edx,[color_line2]
157
	mov	ebx,[line_x]
158
	mov	ecx,[line_y]
159
	inc	ebx
160
	inc	ecx
161
	shl	ebx,16
162
	shl	ecx,16
163
	add	ebx,[line_x]
164
	add	ecx,[line_y]
165
	add	ecx,[line_size_y]
166
	dec	ecx
167
	inc	ebx
168
	call	draw_line
169
;light	line	3
170
	mov	edx,[color_line3]
171
	mov	ebx,[line_x]
172
	mov	ecx,[line_y]
173
	add	ebx,[line_size_x]
174
	dec	ebx
175
	inc	ecx
176
	shl	ebx,16
177
	shl	ecx,16
178
	add	ebx,[line_x]
179
	add	ecx,[line_y]
180
	add	ebx,[line_size_x]
181
	add	ecx,[line_size_y]
182
	dec	ebx
183
	dec	ecx
184
	call	draw_line
185
;light	line	4
186
	mov	edx,[color_line3]
187
	mov	ebx,[line_x]
188
	mov	ecx,[line_y]
189
	add	ecx,[line_size_y]
190
	inc	ebx
191
	dec	ecx
192
	shl	ebx,16
193
	shl	ecx,16
194
	add	ebx,[line_x]
195
	add	ecx,[line_y]
196
	add	ecx,[line_size_y]
197
	add	ebx,[line_size_x]
198
	dec	ecx
199
	dec	ebx
200
	call	draw_line
201
	ret
202
;----------------------------------------------------------
6360 IgorA 203
;input:
204
; eax - rectangle X
205
; ebx - rectangle Y
206
; ecx - point X
207
; edx - point Y
208
; esi - rectangle size X
209
; edi - rectangle size Y
210
;output:
211
; eax - 1 if point in rectangle
180 heavyiron 212
columnus:
1643 mario79 213
	sub	eax,ecx
6360 IgorA 214
	jns	@f
1643 mario79 215
	neg	eax
216
	cmp	eax,esi
6360 IgorA 217
	ja	@f
1643 mario79 218
	sub	ebx,edx
6360 IgorA 219
	jns	@f
1643 mario79 220
	neg	ebx
221
	cmp	ebx,edi
6360 IgorA 222
	ja	@f
1643 mario79 223
	mov	eax,1
224
	jmp	columnus_true
6360 IgorA 225
@@:
1643 mario79 226
	xor	eax,eax
227
columnus_true:
228
	ret
180 heavyiron 229
;----------------------------------------------------------
230
print_text:
1643 mario79 231
	mov	[text_x],eax
232
	mov	[text_y],ebx
233
	mov	ebx,[text_x]
234
	shl	ebx,16
235
	add	ebx,[text_y]
6357 IgorA 236
	mcall SF_DRAW_TEXT
1643 mario79 237
	ret
180 heavyiron 238
;----------------------------------------------------------
239
draw_line:
6357 IgorA 240
	mcall SF_DRAW_LINE
1643 mario79 241
	ret
180 heavyiron 242
;----------------------------------------------------------
243
;lightlin 12508927
1643 mario79 244
;lines 5669590
245
;workpan 9350879
180 heavyiron 246
;btnpress 9089258
1643 mario79 247
line_x		dd	0
248
line_y		dd	0
249
line_size_x	dd	0
250
line_size_y	dd	0
251
color_line1	dd	0
252
color_line2	dd	0
253
color_line3	dd	0
254
color_rectangle	dd	0
180 heavyiron 255
;--------------------
1643 mario79 256
text_x		dd	0
257
text_y		dd	0
180 heavyiron 258
;--------------------