Rev 6379 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6379 | Rev 6385 | ||
---|---|---|---|
Line 1025... | Line 1025... | ||
1025 | ;************************zoom 1************************* |
1025 | ;************************zoom 1************************* |
1026 | cmp eax,45 |
1026 | cmp eax,45 |
1027 | jne no_1_ |
1027 | jne no_1_ |
1028 | mov [k],1 |
1028 | mov [k],1 |
1029 | call scrollbar_move_00 |
1029 | call scrollbar_move_00 |
1030 | and [Current_instrument],0 |
1030 | and [Current_instrument],0 ;??? |
1031 | call drawwin |
1031 | call drawwin |
1032 | ret |
1032 | ret |
1033 | no_1_: |
1033 | no_1_: |
Line 1034... | Line 1034... | ||
1034 | 1034 | ||
Line 1084... | Line 1084... | ||
1084 | 1084 | ||
1085 | ;***************allocation of a countour**************** |
1085 | ;***************allocation of a countour**************** |
1086 | cmp eax,21 |
1086 | cmp eax,21 |
Line 1087... | Line -... | ||
1087 | jne no_allocation |
- | |
1088 | - | ||
1089 | cmp [instrument_used],0 |
- | |
1090 | jnz instrument_not_finished_work |
- | |
1091 | - | ||
1092 | mov al,[Activate_instrument] |
- | |
1093 | test al,al |
- | |
1094 | jnz no_new_allocation_xy |
- | |
1095 | mov eax,[ScreenX] |
- | |
1096 | mov ebx,[ScreenY] |
- | |
1097 | add eax,[PosX] |
- | |
1098 | add ebx,[PosY] |
- | |
1099 | mov [OldX],eax |
- | |
1100 | mov [OldY],ebx |
- | |
1101 | inc eax |
- | |
1102 | inc ebx |
- | |
1103 | mov [rectangular_shade_x],eax |
1087 | jne no_allocation |
1104 | mov [rectangular_shade_y],ebx |
- | |
1105 | mov [Activate_instrument],1 |
- | |
1106 | mov [instrument_used],1 |
- | |
1107 | and [crossing],0 |
- | |
1108 | and [finishing_crossing],0 |
- | |
1109 | xor eax,eax |
- | |
1110 | mov ecx,mem_flood_f/4 |
- | |
1111 | mov edi,[ReserveArray] |
- | |
1112 | cld |
- | |
1113 | rep stosd |
- | |
1114 | ret |
- | |
1115 | no_new_allocation_xy: |
- | |
1116 | instrument_not_finished_work: |
- | |
1117 | - | ||
1118 | mov al,[instrument_used] |
- | |
1119 | test al,al |
- | |
1120 | jz no_change_coordinats |
- | |
1121 | - | ||
1122 | cmp [Activate_instrument],0 |
- | |
1123 | jnz no_change_coordinats |
- | |
1124 | - | ||
1125 | ;save coordinates as old if crossing=0 |
- | |
1126 | cmp [crossing],0 |
- | |
1127 | jnz no_save_coordinate_of_crossing |
- | |
1128 | - | ||
1129 | mov eax,[OldX] |
- | |
1130 | mov ebx,[OldY] |
- | |
1131 | - | ||
1132 | cmp eax,[rectangular_shade_x] |
- | |
1133 | jl no_remove_x |
- | |
1134 | mov ecx,[rectangular_shade_x] |
- | |
1135 | mov [OldX],ecx ; OldX <-----> rectangulare_shade_x |
- | |
1136 | mov [rectangular_shade_x],eax |
- | |
1137 | no_remove_x: |
- | |
1138 | - | ||
1139 | cmp ebx,[rectangular_shade_y] |
- | |
1140 | jl no_remove_y |
- | |
1141 | mov ecx,[rectangular_shade_y] |
- | |
1142 | mov [OldY],ecx ; OldY <-----> rectangulare_shade_y |
- | |
1143 | mov [rectangular_shade_y],ebx |
- | |
1144 | no_remove_y: |
- | |
1145 | - | ||
1146 | mov eax,[ScreenX] |
- | |
1147 | mov ebx,[ScreenY] |
- | |
1148 | add eax,[PosX] |
- | |
1149 | add ebx,[PosY] |
- | |
1150 | mov [crossing_old_x],eax |
- | |
1151 | mov [crossing_old_y],ebx |
- | |
1152 | mov [crossing],1 |
- | |
1153 | - | ||
1154 | - | ||
1155 | mov eax,[OldX] |
- | |
1156 | mov ebx,[OldY] |
- | |
1157 | inc eax |
- | |
1158 | inc ebx |
- | |
1159 | mov [SpriteCoordinatX],eax |
- | |
1160 | mov [SpriteCoordinatY],ebx |
- | |
1161 | mov [SpriteOldCoordinatX],eax |
- | |
1162 | mov [SpriteOldCoordinatY],ebx |
- | |
1163 | mov esi,[rectangular_shade_x] |
- | |
1164 | mov edi,[rectangular_shade_y] |
- | |
1165 | - | ||
1166 | sub esi,eax |
- | |
1167 | jns @f |
- | |
1168 | neg esi ;sign sprite size x |
- | |
1169 | @@: |
- | |
1170 | - | ||
1171 | sub edi,ebx |
- | |
1172 | jns @f |
- | |
1173 | neg edi ;sign sprite size y |
- | |
1174 | @@: |
- | |
1175 | - | ||
1176 | test esi,esi |
- | |
1177 | jnz @f |
- | |
1178 | mov esi,1 ;null sprite x |
- | |
1179 | @@: |
- | |
1180 | - | ||
1181 | test edi,edi |
- | |
1182 | jnz @f |
- | |
1183 | mov edi,1 ;null sprite y |
- | |
1184 | @@: |
- | |
1185 | - | ||
1186 | mov [SpriteSizeX],esi |
- | |
1187 | mov [SpriteSizeY],edi |
- | |
1188 | - | ||
1189 | call SaveFonForSprite |
- | |
1190 | - | ||
1191 | no_save_coordinate_of_crossing: |
- | |
1192 | - | ||
1193 | cmp [crossing],0 |
- | |
1194 | je no_test_crossing_with_work_arrea |
- | |
1195 | ;if mouse situatad after allocation than exit |
- | |
Line 1196... | Line 1088... | ||
1196 | push [ScreenX] |
1088 | |
Line -... | Line 1089... | ||
- | 1089 | mov [Activate_instrument],1 |
|
- | 1090 | ||
- | 1091 | call GetScreenCordinats |
|
- | 1092 | ||
- | 1093 | bt [MouseBut],8 ;left button down |
|
1197 | push [ScreenY] |
1094 | jnc .left_but_down |
1198 | 1095 | cmp [crossing],2 |
|
1199 | call GetScreenCordinats |
1096 | jne @f |
1200 | 1097 | ;move old selection |
|
1201 | mov eax,[OldX] |
- | |
1202 | mov ebx,[OldY] |
- | |
1203 | mov ecx,[ScreenX] |
1098 | mov eax,[crossing_old_x] |
1204 | mov edx,[ScreenY] |
1099 | mov ebx,[crossing_old_y] |
1205 | mov esi,[SpriteSizeX] |
- | |
1206 | mov edi,[SpriteSizeY] |
- | |
1207 | add ecx,[PosX] |
- | |
1208 | add edx,[PosY] |
- | |
1209 | inc esi |
- | |
1210 | inc edi |
- | |
1211 | call columnus |
- | |
1212 | - | ||
1213 | test eax,eax |
- | |
1214 | jnz crossing_with_work_area |
- | |
1215 | mov [finishing_crossing],1 |
- | |
1216 | crossing_with_work_area: |
- | |
1217 | - | ||
1218 | pop [ScreenY] |
- | |
1219 | pop [ScreenX] |
- | |
1220 | - | ||
1221 | no_test_crossing_with_work_arrea: |
- | |
1222 | - | ||
1223 | mov eax,[ScreenX] |
- | |
1224 | mov ebx,[ScreenY] |
- | |
1225 | add eax,[PosX] |
- | |
1226 | add ebx,[PosY] |
- | |
1227 | mov ecx,eax |
- | |
1228 | mov edx,ebx |
- | |
1229 | sub eax,[crossing_old_x] ;dx=(x-oldx) |
- | |
1230 | sub ebx,[crossing_old_y] ;dy=(y-oldy) |
- | |
1231 | mov [crossing_old_x],ecx |
- | |
1232 | mov [crossing_old_y],edx |
- | |
1233 | - | ||
1234 | add [OldX],eax ;x1=x1+dx |
- | |
1235 | add [OldY],ebx ;y1=y1+dy |
- | |
1236 | add [rectangular_shade_x],eax ;x2=x2+dx |
- | |
1237 | add [rectangular_shade_y],ebx ;y2+y2+dy |
- | |
1238 | - | ||
1239 | mov eax,[OldX] |
- | |
1240 | mov ebx,[OldY] |
- | |
1241 | inc eax |
- | |
1242 | inc ebx |
- | |
1243 | mov [SpriteCoordinatX],eax |
- | |
1244 | mov [SpriteCoordinatY],ebx |
- | |
1245 | - | ||
1246 | cmp [SpriteCoordinatX],0 |
- | |
1247 | jns @f |
- | |
1248 | mov [SpriteCoordinatX],1 ;null sprite coordinat x |
- | |
1249 | @@: |
- | |
1250 | cmp [SpriteCoordinatY],0 |
- | |
1251 | jns @f |
1100 | mov ecx,[ScreenX] |
1252 | mov [SpriteCoordinatY],1 ;null sprite coordinat y |
1101 | mov edx,[ScreenY] |
- | 1102 | add ecx,[PosX] |
|
- | 1103 | add edx,[PosY] |
|
- | 1104 | mov esi,[rectangular_shade_x] |
|
Line 1253... | Line -... | ||
1253 | @@: |
- | |
1254 | - | ||
1255 | mov esi,[rectangular_shade_x] |
1105 | mov edi,[rectangular_shade_y] |
1256 | mov edi,[rectangular_shade_y] |
- | |
1257 | - | ||
1258 | sub esi,[OldX] |
1106 | sub esi,eax |
1259 | jns @f |
- | |
1260 | neg esi |
- | |
1261 | @@: |
- | |
1262 | sub edi,[OldY] |
1107 | sub edi,ebx |
1263 | jns @f |
- | |
1264 | neg edi |
- | |
1265 | @@: |
- | |
1266 | - | ||
1267 | mov ecx,[OldX] |
- | |
1268 | mov edx,[OldY] |
- | |
1269 | 1108 | call columnus |
|
1270 | sub ecx,[PosX] |
- | |
1271 | jns @f |
- | |
1272 | xor ecx,ecx |
- | |
1273 | add ecx,[PosX] |
- | |
1274 | mov [OldX],ecx |
- | |
1275 | add ecx,esi |
- | |
1276 | mov [rectangular_shade_x],ecx |
- | |
1277 | @@: |
- | |
1278 | 1109 | ||
1279 | sub edx,[PosY] |
- | |
1280 | jns @f |
- | |
1281 | xor edx,edx |
- | |
1282 | add edx,[PosY] |
- | |
1283 | mov [OldY],edx |
1110 | test eax,eax |
1284 | add edx,edi |
- | |
1285 | mov [rectangular_shade_y],edx |
- | |
1286 | @@: |
- | |
1287 | - | ||
1288 | mov ecx,[Picture_SizeX] |
- | |
1289 | sub ecx,esi |
- | |
1290 | cmp [OldX],ecx |
- | |
1291 | jl @f |
1111 | jz @f |
- | 1112 | mov [crossing],3 |
|
- | 1113 | mov [OldX],ecx |
|
- | 1114 | mov [OldY],edx |
|
- | 1115 | jmp selection_update |
|
- | 1116 | @@: |
|
- | 1117 | ;start new selection |
|
- | 1118 | mov eax,[ScreenX] |
|
- | 1119 | add eax,[PosX] |
|
- | 1120 | mov [crossing_old_x],eax |
|
- | 1121 | mov [rectangular_shade_x],eax |
|
- | 1122 | mov eax,[ScreenY] |
|
- | 1123 | add eax,[PosY] |
|
Line -... | Line 1124... | ||
- | 1124 | mov [crossing_old_y],eax |
|
- | 1125 | mov [rectangular_shade_y],eax |
|
- | 1126 | mov [crossing],1 |
|
- | 1127 | jmp selection_update |
|
- | 1128 | .left_but_down: |
|
1292 | dec ecx |
1129 | |
- | 1130 | bt [MouseBut],0 ;left button press |
|
1293 | mov [OldX],ecx |
1131 | jnc .no_mouse_move |
1294 | add ecx,esi |
1132 | cmp [crossing],3 |
- | 1133 | jne .no_sel_move |
|
- | 1134 | ;move selection |
|
- | 1135 | mov eax,[ScreenX] |
|
1295 | mov [rectangular_shade_x],ecx |
1136 | add eax,[PosX] |
- | 1137 | sub eax,[OldX] |
|
- | 1138 | add [OldX],eax |
|
1296 | @@: |
1139 | mov ebx,[crossing_old_x] |
- | 1140 | add ebx,eax |
|
- | 1141 | cmp ebx,0 |
|
- | 1142 | jge @f |
|
- | 1143 | ;exit from left border |
|
- | 1144 | sub eax,ebx |
|
1297 | 1145 | @@: |
|
- | 1146 | add [crossing_old_x],eax |
|
1298 | mov edx,[Picture_SizeY] |
1147 | add [rectangular_shade_x],eax |
- | 1148 | mov eax,[ScreenY] |
|
- | 1149 | add eax,[PosY] |
|
- | 1150 | sub eax,[OldY] |
|
- | 1151 | add [OldY],eax |
|
- | 1152 | mov ebx,[crossing_old_y] |
|
- | 1153 | add ebx,eax |
|
- | 1154 | cmp ebx,0 |
|
- | 1155 | jge @f |
|
- | 1156 | ;exit from top border |
|
- | 1157 | sub eax,ebx |
|
- | 1158 | @@: |
|
- | 1159 | add [crossing_old_y],eax |
|
- | 1160 | add [rectangular_shade_y],eax |
|
- | 1161 | jmp selection_update |
|
- | 1162 | .no_sel_move: |
|
1299 | sub edx,edi |
1163 | ;resize selection |
- | 1164 | mov eax,[ScreenX] |
|
- | 1165 | add eax,[PosX] |
|
- | 1166 | mov [rectangular_shade_x],eax |
|
- | 1167 | mov eax,[ScreenY] |
|
- | 1168 | add eax,[PosY] |
|
- | 1169 | mov [rectangular_shade_y],eax |
|
- | 1170 | jmp selection_update |
|
- | 1171 | .no_mouse_move: |
|
- | 1172 | ||
- | 1173 | bt [MouseBut],16 ;left button up |
|
- | 1174 | jnc .left_but_up |
|
- | 1175 | ;finish selection |
|
1300 | cmp [OldY],edx |
1176 | mov eax,[crossing_old_x] |
1301 | jl @f |
- | |
1302 | dec edx |
1177 | mov ebx,[rectangular_shade_x] |
1303 | mov [OldY],edx |
1178 | cmp eax,ebx |
1304 | add edx,edi |
1179 | jle @f |
1305 | mov [rectangular_shade_y],edx |
1180 | mov [crossing_old_x],ebx |
1306 | @@: |
1181 | mov [rectangular_shade_x],eax |
1307 | 1182 | @@: |
|
- | 1183 | mov eax,[crossing_old_y] |
|
1308 | mov eax,[rectangular_shade_x] |
1184 | mov ebx,[rectangular_shade_y] |
1309 | mov ebx,[rectangular_shade_y] |
1185 | cmp eax,ebx |
1310 | sub eax,[PosX] |
- | |
1311 | sub ebx,[PosY] |
1186 | jle @f |
Line -... | Line 1187... | ||
- | 1187 | mov [crossing_old_y],ebx |
|
- | 1188 | mov [rectangular_shade_y],eax |
|
- | 1189 | @@: |
|
1312 | mov [ScreenX],eax |
1190 | mov [crossing],2 |
1313 | mov [ScreenY],ebx |
1191 | ret |
- | 1192 | .left_but_up: |
|
Line -... | Line 1193... | ||
- | 1193 | ||
1314 | no_change_coordinats: |
1194 | bt [MouseBut],9 ;right button down |
1315 | 1195 | jnc .right_but_down |
|
1316 | ;put saved pixels |
1196 | ;delete select |
1317 | square_width_put |
1197 | mov [crossing],0 |
1318 | - | ||
1319 | cmp [DrawSprite_flag],1 |
- | |
1320 | jne no_activate_put_fon_ |
- | |
1321 | - | ||
1322 | cmp [Paste_flag],1 |
- | |
1323 | je @f |
- | |
1324 | call PutFonForSprite |
- | |
1325 | @@: |
- | |
1326 | and [Paste_flag],0 |
- | |
1327 | no_activate_put_fon_: |
- | |
1328 | - | ||
1329 | cmp [finishing_crossing],0 |
- | |
1330 | jz not_finish_from_instrument_crossing |
- | |
1331 | and [Activate_instrument],0 |
- | |
1332 | and [crossing],0 |
- | |
1333 | and [instrument_used],0 |
- | |
1334 | and [DrawSprite_flag],0 |
- | |
1335 | call MovePictureToWorkScreen |
- | |
1336 | ret |
- | |
1337 | not_finish_from_instrument_crossing: |
- | |
1338 | - | ||
1339 | ;calculate line |
- | |
1340 | mov ebx,[ReserveArray] |
- | |
1341 | add ebx,4 |
- | |
1342 | mov eax,[PointerToPicture] |
- | |
1343 | mov ecx,[Picture_SizeX] |
- | |
1344 | mov edx,[OldX] |
- | |
1345 | shl edx,16 |
- | |
1346 | add edx,[OldY] |
- | |
1347 | mov esi,[ScreenX] |
- | |
1348 | mov edi,[ScreenY] |
- | |
1349 | add esi,[PosX] |
- | |
1350 | add edi,[PosY] |
- | |
1351 | - | ||
1352 | mov ebp,[Picture_SizeX] |
- | |
1353 | dec ebp |
- | |
1354 | cmp esi,ebp |
- | |
1355 | jl @f |
- | |
1356 | mov esi,ebp ;minimum x allocation |
- | |
1357 | @@: |
- | |
1358 | - | ||
1359 | mov ebp,[Picture_SizeY] |
- | |
1360 | dec ebp |
- | |
1361 | cmp edi,ebp |
- | |
1362 | jl @f |
- | |
1363 | mov edi,ebp ;minimum y allocation |
1198 | jmp selection_update |
1364 | @@: |
1199 | .right_but_down: |
1365 | - | ||
1366 | call calculate_rectangle |
- | |
1367 | - | ||
1368 | ;save color pixels in ReserveArray |
- | |
1369 | square_width_save |
- | |
1370 | - | ||
1371 | cmp [DrawSprite_flag],1 |
1200 | |
1372 | jne @f |
- | |
1373 | ;save current coordinats as old |
- | |
1374 | mov eax,[SpriteCoordinatX] |
- | |
1375 | mov ebx,[SpriteCoordinatY] |
- | |
1376 | mov [SpriteOldCoordinatX],eax |
- | |
1377 | mov [SpriteOldCoordinatY],ebx |
1201 | if 0 |
1378 | 1202 | cmp [Paste_flag],1 |
|
- | 1203 | je @f |
|
Line 1379... | Line -... | ||
1379 | call SaveFonForSprite |
- | |
1380 | - | ||
1381 | @@: |
- | |
1382 | - | ||
1383 | cmp [DrawSprite_flag],1 |
- | |
1384 | jne @f |
- | |
1385 | call DrawSprite |
- | |
1386 | @@: |
- | |
1387 | - | ||
1388 | mov al,[instrument_used] |
- | |
1389 | test al,al |
- | |
1390 | jz no_change_coordinats |
1204 | call PutFonForSprite |
1391 | cmp [Activate_instrument],0 |
- | |
1392 | jz no_save_shades |
1205 | @@: |
1393 | mov eax,[ScreenX] |
1206 | cmp [DrawSprite_flag],1 |
1394 | mov ebx,[ScreenY] |
1207 | jne @f |
Line 1395... | Line 1208... | ||
1395 | add eax,[PosX] |
1208 | call SaveFonForSprite |