Rev 682 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 682 | Rev 706 | ||
---|---|---|---|
1 | im_control_data_size = 26 |
1 | im_control_data_size = 26 |
2 | im_redraw_all = 10000000b |
2 | im_redraw_all = 10000000b |
3 | im_redraw_all_off = 01111111b |
3 | im_redraw_all_off = 01111111b |
4 | ;im_special_redraw_on = 00000001b |
4 | ;im_special_redraw_on = 00000001b |
5 | ;im_special_redraw_off = 11111110b |
5 | ;im_special_redraw_off = 11111110b |
6 | 6 | ||
7 | ;**************************************************** |
7 | ;**************************************************** |
8 | ;*******************craete Image********************** |
8 | ;*******************craete Image********************** |
9 | ;**************************************************** |
9 | ;**************************************************** |
10 | ;IN |
10 | ;IN |
11 | ;pointer to parend |
11 | ;pointer to parend |
12 | ;pointer to Image's structure |
12 | ;pointer to Image's structure |
13 | ;OUT |
13 | ;OUT |
14 | ;pointer to initialized Image's structure |
14 | ;pointer to initialized Image's structure |
15 | align 4 |
15 | align 4 |
16 | 16 | ||
17 | craete_image: |
17 | craete_image: |
18 | 18 | ||
- | 19 | push ebx |
|
- | 20 | push ecx |
|
- | 21 | push edx |
|
- | 22 | push esi |
|
- | 23 | push edi |
|
- | 24 | push ebp |
|
- | 25 | ||
19 | mov ebx,[esp+4] |
26 | mov ebx,[esp+24+4] |
20 | mov eax,[esp+8] |
27 | mov eax,[esp+24+8] |
21 | 28 | ||
22 | mov [PointerToStructureForImage],eax |
29 | mov [PointerToStructureForImage],eax |
23 | 30 | ||
24 | mov eax,control_header_size+im_control_data_size |
31 | mov eax,control_header_size+im_control_data_size |
25 | call craete_control |
32 | call craete_control |
26 | 33 | ||
27 | ;set all image's parameters in control |
34 | ;set all image's parameters in control |
28 | mov [eax],dword image |
35 | mov [eax],dword image |
29 | 36 | ||
30 | mov ecx,im_control_data_size |
37 | mov ecx,im_control_data_size |
31 | mov esi,[PointerToStructureForImage] |
38 | mov esi,[PointerToStructureForImage] |
32 | mov edi,eax |
39 | mov edi,eax |
33 | add edi,control_header_size |
40 | add edi,control_header_size |
34 | rep movsb |
41 | rep movsb |
35 | 42 | ||
36 | call get_skin_height |
43 | call get_skin_height |
37 | 44 | ||
38 | mov ebx,[PointerToStructureForImage] |
45 | mov ebx,[PointerToStructureForImage] |
39 | mov ecx,[ebx+6] ;x |
46 | mov ecx,[ebx+6] ;x |
40 | mov edx,[ebx+10] ;y |
47 | mov edx,[ebx+10] ;y |
41 | mov esi,[ebx+14] ;size x |
48 | mov esi,[ebx+14] ;size x |
42 | mov edi,[ebx+18] ;size y |
49 | mov edi,[ebx+18] ;size y |
43 | add ecx,border_width |
50 | add ecx,border_width |
44 | add edx,[skin_height] |
51 | add edx,[skin_height] |
45 | ;copy information to control |
52 | ;copy information to control |
46 | mov [eax+24],ecx |
53 | mov [eax+24],ecx |
47 | mov [eax+28],edx |
54 | mov [eax+28],edx |
48 | mov [eax+32],esi |
55 | mov [eax+32],esi |
49 | mov [eax+36],edi |
56 | mov [eax+36],edi |
50 | 57 | ||
- | 58 | pop ebp |
|
- | 59 | pop edi |
|
- | 60 | pop esi |
|
- | 61 | pop edx |
|
- | 62 | pop ecx |
|
- | 63 | pop ebx |
|
- | 64 | ||
51 | ret 8 |
65 | ret 8 |
52 | 66 | ||
53 | ;**************************************************** |
67 | ;**************************************************** |
54 | ;********************Draw Image********************** |
68 | ;********************Draw Image********************** |
55 | ;**************************************************** |
69 | ;**************************************************** |
56 | ;IN |
70 | ;IN |
57 | ;pointer to control of button |
71 | ;pointer to control of button |
58 | ;message |
72 | ;message |
59 | ;OUT |
73 | ;OUT |
60 | ;not returned value |
74 | ;not returned value |
61 | align 4 |
75 | align 4 |
62 | 76 | ||
63 | image: |
77 | image: |
64 | 78 | ||
65 | ;get message |
79 | ;get message |
66 | mov eax,[esp+8] |
80 | mov eax,[esp+8] |
67 | 81 | ||
68 | ;get pointer to control of image |
82 | ;get pointer to control of image |
69 | mov esi,[esp+4] |
83 | mov esi,[esp+4] |
70 | mov [PointerForImage],esi |
84 | mov [PointerForImage],esi |
71 | ;copy control to local control |
85 | ;copy control to local control |
72 | add esi,control_header_size |
86 | add esi,control_header_size |
73 | mov edi,dword Image |
87 | mov edi,dword Image |
74 | mov ecx,im_control_data_size |
88 | mov ecx,im_control_data_size |
75 | rep movsb |
89 | rep movsb |
76 | 90 | ||
77 | 91 | ||
78 | cmp [eax],dword 1 |
92 | cmp [eax],dword 1 |
79 | jne no_redraw_all_image |
93 | jne no_redraw_all_image |
80 | 94 | ||
81 | or [Image.type],im_redraw_all |
95 | or [Image.type],im_redraw_all |
82 | no_redraw_all_image: |
96 | no_redraw_all_image: |
83 | 97 | ||
84 | cmp [eax],dword 3 |
98 | cmp [eax],dword 3 |
85 | jne no_special_message_image |
99 | jne no_special_message_image |
86 | 100 | ||
87 | xor eax,eax |
101 | xor eax,eax |
88 | mov al,[Image.type] |
102 | mov al,[Image.type] |
89 | and al,activate_trap |
103 | and al,activate_trap |
90 | test al,al |
104 | test al,al |
91 | jz no_activate_redraw_image |
105 | jz no_activate_redraw_image |
92 | 106 | ||
93 | and [Image.type],deactivate_trap |
107 | and [Image.type],deactivate_trap |
94 | or [Image.type],im_redraw_all |
108 | or [Image.type],im_redraw_all |
95 | no_activate_redraw_image: |
109 | no_activate_redraw_image: |
96 | 110 | ||
97 | no_special_message_image: |
111 | no_special_message_image: |
98 | 112 | ||
99 | ;load coordinats and size from control |
113 | ;load coordinats and size from control |
100 | mov eax,[PointerForImage] |
114 | mov eax,[PointerForImage] |
101 | mov ebx,[eax+24] ;x |
115 | mov ebx,[eax+24] ;x |
102 | mov ecx,[eax+28] ;y |
116 | mov ecx,[eax+28] ;y |
103 | mov edx,[eax+32] ;size x |
117 | mov edx,[eax+32] ;size x |
104 | mov esi,[eax+36] ;size y |
118 | mov esi,[eax+36] ;size y |
105 | ;set current coordinats and sizes in zakladka |
119 | ;set current coordinats and sizes in zakladka |
106 | mov [Image.x],ebx |
120 | mov [Image.x],ebx |
107 | mov [Image.y],ecx |
121 | mov [Image.y],ecx |
108 | mov [Image.sizex],edx |
122 | mov [Image.sizex],edx |
109 | mov [Image.sizey],esi |
123 | mov [Image.sizey],esi |
110 | 124 | ||
111 | xor eax,eax |
125 | xor eax,eax |
112 | mov al,[Image.type] |
126 | mov al,[Image.type] |
113 | and al,im_redraw_all |
127 | and al,im_redraw_all |
114 | test al,al |
128 | test al,al |
115 | jz no_redraw_image_ |
129 | jz no_redraw_image_ |
116 | 130 | ||
117 | and [Image.type],im_redraw_all_off |
131 | and [Image.type],im_redraw_all_off |
118 | 132 | ||
119 | mov esi,dword Image |
133 | mov esi,dword Image |
120 | mov edi,[PointerForImage] |
134 | mov edi,[PointerForImage] |
121 | add edi,control_header_size |
135 | add edi,control_header_size |
122 | mov ecx,2 |
136 | mov ecx,2 |
123 | rep movsb |
137 | rep movsb |
124 | 138 | ||
125 | mov eax,7 |
139 | mov eax,7 |
126 | mov ebx,[Image.pointer] |
140 | mov ebx,[Image.pointer] |
127 | mov ecx,[Image.sizex] |
141 | mov ecx,[Image.sizex] |
128 | shl ecx,16 |
142 | shl ecx,16 |
129 | add ecx,[Image.sizey] |
143 | add ecx,[Image.sizey] |
130 | mov edx,[Image.x] |
144 | mov edx,[Image.x] |
131 | shl edx,16 |
145 | shl edx,16 |
132 | add edx,[Image.y] |
146 | add edx,[Image.y] |
133 | mcall |
147 | mcall |
134 | 148 | ||
135 | no_redraw_image_: |
149 | no_redraw_image_: |
136 | 150 | ||
137 | exit_image: |
151 | exit_image: |
138 | 152 | ||
139 | mov edi,[PointerForImage] |
153 | mov edi,[PointerForImage] |
140 | add edi,control_header_size |
154 | add edi,control_header_size |
141 | mov esi,dword Image |
155 | mov esi,dword Image |
142 | mov ecx,im_control_data_size |
156 | mov ecx,im_control_data_size |
143 | rep movsb |
157 | rep movsb |
144 | 158 | ||
145 | ret 8 |
159 | ret 8 |