Subversion Repositories Kolibri OS

Rev

Rev 3969 | Rev 6247 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3969 Rev 5390
Line 13... Line 13...
13
include '../../../../programs/proc32.inc'
13
include '../../../../programs/proc32.inc'
14
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
14
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
15
include '../../../dll.inc'
15
include '../../../dll.inc'
16
include 'vox_draw.inc'
16
include 'vox_draw.inc'
17
include 'vox_rotate.inc'
17
include 'vox_rotate.inc'
-
 
18
include 'str.inc'
Line 18... Line 19...
18
 
19
 
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
20
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
Line 20... Line 21...
20
caption db 'Voxel editor 03.10.13',0 ;¯®¤¯¨áì ®ª­ 
21
caption db 'Voxel editor 02.02.15',0 ;¯®¤¯¨áì ®ª­ 
21
 
22
 
22
struct FileInfoBlock
23
struct FileInfoBlock
23
	Function dd ?
24
	Function dd ?
Line 32... Line 33...
32
run_file_70 FileInfoBlock
33
run_file_70 FileInfoBlock
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
34
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
Line 34... Line 35...
34
 
35
 
35
fn_toolbar db 'toolbar.png',0
36
fn_toolbar db 'toolbar.png',0
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
37
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*24
38
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*27
38
image_data_toolbar dd 0
39
image_data_toolbar dd 0
39
cursors_count equ 4
40
cursors_count equ 4
Line 40... Line 41...
40
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
41
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
Line 446... Line 447...
446
	mov edx,3
447
	mov edx,3
447
	mov esi,[sc.work_button]
448
	mov esi,[sc.work_button]
448
	int 0x40
449
	int 0x40
Line 449... Line 450...
449
 
450
 
450
	mov ebx,(30 shl 16)+20
451
	mov ebx,(30 shl 16)+20
451
	mov edx,4
452
	inc edx
452
	int 0x40
453
	int 0x40
453
	add ebx,25 shl 16
454
	add ebx,25 shl 16
454
	mov edx,5
455
	inc edx
455
	int 0x40
456
	int 0x40
-
 
457
	add ebx,30 shl 16
-
 
458
	inc edx
-
 
459
	int 0x40
456
	add ebx,30 shl 16
460
	add ebx,25 shl 16
-
 
461
	inc edx
-
 
462
	int 0x40
-
 
463
	add ebx,25 shl 16
-
 
464
	inc edx
-
 
465
	int 0x40
-
 
466
	add ebx,25 shl 16
457
	mov edx,6
467
	inc edx
458
	int 0x40
468
	int 0x40
459
	add ebx,25 shl 16
469
	add ebx,25 shl 16
460
	mov edx,7
470
	inc edx
461
	int 0x40
471
	int 0x40
462
	add ebx,25 shl 16
472
	add ebx,25 shl 16
463
	mov edx,8
473
	inc edx
464
	int 0x40
474
	int 0x40
465
	add ebx,25 shl 16
475
	add ebx,25 shl 16
466
	mov edx,9
476
	inc edx
467
	int 0x40
477
	int 0x40
468
	add ebx,25 shl 16
478
	add ebx,25 shl 16
469
	mov edx,10
479
	inc edx
470
	int 0x40
480
	int 0x40
471
	add ebx,25 shl 16
481
	add ebx,25 shl 16
472
	mov edx,11
482
	inc edx
473
	int 0x40
483
	int 0x40
474
	add ebx,25 shl 16
484
	add ebx,25 shl 16
475
	mov edx,12
485
	inc edx
476
	int 0x40
486
	int 0x40
477
	add ebx,25 shl 16
487
	add ebx,25 shl 16
478
	mov edx,13
488
	inc edx
479
	int 0x40
489
	int 0x40
480
	add ebx,25 shl 16
490
	add ebx,25 shl 16
481
	mov edx,14
491
	inc edx
482
	int 0x40
492
	int 0x40
483
	add ebx,25 shl 16
493
	add ebx,25 shl 16
484
	mov edx,15
494
	inc edx
485
	int 0x40
495
	int 0x40
486
	add ebx,25 shl 16
496
	add ebx,25 shl 16
487
	mov edx,16
497
	inc edx
488
	int 0x40
498
	int 0x40
489
	add ebx,25 shl 16
499
	add ebx,25 shl 16
490
	mov edx,17
500
	inc edx
491
	int 0x40
501
	int 0x40
492
	add ebx,25 shl 16
502
	add ebx,25 shl 16
493
	mov edx,18
503
	inc edx
494
	int 0x40
504
	int 0x40
495
	add ebx,25 shl 16
505
	add ebx,25 shl 16
496
	mov edx,19
506
	inc edx
497
	int 0x40
507
	int 0x40
498
	add ebx,25 shl 16
508
	add ebx,25 shl 16
499
	mov edx,20
509
	inc edx
500
	int 0x40
510
	int 0x40
501
	add ebx,25 shl 16
511
	add ebx,25 shl 16
502
	mov edx,21
512
	inc edx
503
	int 0x40
513
	int 0x40
504
	add ebx,25 shl 16
514
	add ebx,25 shl 16
505
	mov edx,22
515
	inc edx
506
	int 0x40
516
	int 0x40
507
	add ebx,25 shl 16
517
	add ebx,25 shl 16
508
	mov edx,23
518
	inc edx
509
	int 0x40
519
	int 0x40
510
	add ebx,25 shl 16
520
	add ebx,25 shl 16
511
	mov edx,24
521
	inc edx
512
	int 0x40
522
	int 0x40
513
	add ebx,25 shl 16
523
	add ebx,25 shl 16
514
	mov edx,25
524
	inc edx
515
	int 0x40
525
	int 0x40
516
	add ebx,25 shl 16
526
	add ebx,25 shl 16
517
	mov edx,26
527
	inc edx
Line 518... Line 528...
518
	int 0x40
528
	int 0x40
519
 
529
 
520
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
530
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
Line 592... Line 602...
592
	add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠-1
602
	add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠-1
593
	int 0x40
603
	int 0x40
594
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
604
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
595
	add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠+1
605
	add edx,(25 shl 16) ;¢ëá®â  ª¨á⨠+1
596
	int 0x40
606
	int 0x40
-
 
607
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
-
 
608
	add edx,(25 shl 16) ;®âà §¨âì ª¨áâì £®à.
-
 
609
	int 0x40
-
 
610
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
-
 
611
	add edx,(25 shl 16) ;®âà §¨âì ª¨áâì ¢¥à.
-
 
612
	int 0x40
-
 
613
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
-
 
614
	add edx,(25 shl 16) ;¯®¢¥à­ãâì ª¨áâì 90 £à.
-
 
615
	int 0x40
Line 597... Line 616...
597
 
616
 
598
	; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
617
	; *** à¨á®¢ ­¨¥ ¡ãä¥à®¢ ***
599
	call draw_objects
618
	call draw_objects
Line 619... Line 638...
619
 
638
 
620
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
639
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ªãàá®à 
621
	mov dword[txt_curor.size],0
640
	mov dword[txt_curor.size],0
622
	mov eax,dword[v_cur_x]
641
	mov eax,dword[v_cur_x]
623
	mov edi,txt_curor.size
642
	mov edi,txt_curor.size
624
	call convert_int_to_str
643
	stdcall convert_int_to_str,10
625
	stdcall str_cat, edi,txt_mull
644
	stdcall str_cat, edi,txt_mull
626
	mov eax,dword[v_cur_y]
645
	mov eax,dword[v_cur_y]
627
	mov edi,txt_buf
646
	mov edi,txt_buf
628
	call convert_int_to_str
647
	stdcall convert_int_to_str,16
629
	stdcall str_cat, txt_curor.size,edi
648
	stdcall str_cat, txt_curor.size,edi
Line 630... Line 649...
630
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
649
	stdcall str_cat, txt_curor.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
631
 
650
 
632
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
651
	;®¡­®¢«¥­¨¥ ¯ à ¬¥â஢ ª¨áâ¨
633
	mov dword[txt_brush.size],0
652
	mov dword[txt_brush.size],0
634
	mov eax,dword[brush_w]
653
	mov eax,dword[brush_w]
635
	mov edi,txt_brush.size
654
	mov edi,txt_brush.size
636
	call convert_int_to_str
655
	stdcall convert_int_to_str,10
637
	stdcall str_cat, edi,txt_mull
656
	stdcall str_cat, edi,txt_mull
638
	mov eax,dword[brush_h]
657
	mov eax,dword[brush_h]
639
	mov edi,txt_buf
658
	mov edi,txt_buf
640
	call convert_int_to_str
659
	stdcall convert_int_to_str,16
Line 641... Line 660...
641
	stdcall str_cat, txt_brush.size,edi
660
	stdcall str_cat, txt_brush.size,edi
642
	stdcall str_cat, txt_brush.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
661
	stdcall str_cat, txt_brush.size,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
Line 793... Line 812...
793
	@@:
812
	@@:
794
	cmp ah,26
813
	cmp ah,26
795
	jne @f
814
	jne @f
796
		call but_bru_h_p
815
		call but_bru_h_p
797
	@@:
816
	@@:
-
 
817
	cmp ah,27
-
 
818
	jne @f
-
 
819
		call but_bru_flip_h
-
 
820
	@@:
-
 
821
	cmp ah,28
-
 
822
	jne @f
-
 
823
		call but_bru_flip_v
-
 
824
	@@:
-
 
825
	cmp ah,29
-
 
826
	jne @f
-
 
827
		call but_bru_rot_90
-
 
828
	@@:
798
	cmp ah,1
829
	cmp ah,1
799
	jne still
830
	jne still
800
.exit:
831
.exit:
801
	stdcall [buf2d_delete],buf_0
832
	stdcall [buf2d_delete],buf_0
802
	stdcall [buf2d_delete],buf_0z
833
	stdcall [buf2d_delete],buf_0z
Line 831... Line 862...
831
	ret
862
	ret
832
endp
863
endp
Line 833... Line 864...
833
 
864
 
834
align 4
865
align 4
-
 
866
open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
Line 835... Line 867...
835
open_file_vox dd 0 ;㪠§ â¥«ì ­  ®¡« áâì ¤«ï ®âªàëâ¨ï ä ©«®¢
867
open_b rb 560
836
 
868
 
837
align 4
869
align 4
838
but_open_file:
870
but_open_file:
Line 843... Line 875...
843
	cmp [OpenDialog_data.status],2
875
	cmp [OpenDialog_data.status],2
844
	je .end_open_file
876
	je .end_open_file
845
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
877
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
Line 846... Line 878...
846
 
878
 
-
 
879
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
-
 
880
	mov [run_file_70.Function], 5
-
 
881
	mov [run_file_70.Position], 0
-
 
882
	mov [run_file_70.Flags], 0
-
 
883
	mov dword[run_file_70.Count], 0
-
 
884
	mov dword[run_file_70.Buffer], open_b
-
 
885
	mov byte[run_file_70+20], 0
-
 
886
	mov dword[run_file_70.FileName], openfile_path
-
 
887
	mov ebx,run_file_70
-
 
888
	int 0x40
-
 
889
 
-
 
890
	mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
-
 
891
	cmp ecx,[max_open_file_size] ;¯à®¢¥à塞 à §¬¥à ¢ë¤¥«¥­­®© ¯ ¬ïâ¨
-
 
892
	jle @f
-
 
893
		mov [max_open_file_size],ecx
-
 
894
		stdcall mem.ReAlloc,[open_file_vox],ecx
-
 
895
		mov [open_file_vox],eax
-
 
896
		notify_window_run txt_need_memory
-
 
897
	@@:
-
 
898
	
847
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
899
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
848
	mov [run_file_70.Function], 0
900
	mov [run_file_70.Function], 0
849
	mov [run_file_70.Position], 0
901
	mov [run_file_70.Position], 0
850
	mov [run_file_70.Flags], 0
902
	mov [run_file_70.Flags], 0
851
	m2m dword[run_file_70.Count], dword[max_open_file_size]
903
	mov dword[run_file_70.Count], ecx
852
	m2m [run_file_70.Buffer], [open_file_vox]
904
	m2m dword[run_file_70.Buffer], dword[open_file_vox]
853
	mov byte[run_file_70+20], 0
905
	mov byte[run_file_70+20], 0
854
	mov dword[run_file_70.FileName], openfile_path
906
	mov dword[run_file_70.FileName], openfile_path
855
	mov ebx,run_file_70
907
	mov ebx,run_file_70
856
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
908
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
857
	cmp ebx,0xffffffff
909
	cmp ebx,0xffffffff
Line 858... Line -...
858
	je .end_open_file
-
 
859
 
-
 
860
	;add ebx,[open_file_vox]
910
	je .end_open_file
Line 861... Line 911...
861
	;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
911
 
862
	mcall 71,1,openfile_path
912
	mcall 71,1,openfile_path
863
 
913
 
Line 889... Line 939...
889
		mov ebx,[open_file_vox]
939
		mov ebx,[open_file_vox]
890
		mov byte[ebx],al
940
		mov byte[ebx],al
Line 891... Line 941...
891
 
941
 
892
		stdcall buf2d_vox_obj_get_size, ebx
942
		stdcall buf2d_vox_obj_get_size, ebx
893
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
-
 
894
		mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
943
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
895
		mov [run_file_70.Function], 2
944
		mov [run_file_70.Function], 2
896
		mov [run_file_70.Position], 0
945
		mov [run_file_70.Position], 0
897
		mov [run_file_70.Flags], 0
946
		mov [run_file_70.Flags], 0
898
		mov ebx, dword[open_file_vox]
947
		mov ebx, dword[open_file_vox]
899
		mov [run_file_70.Buffer], ebx
948
		mov [run_file_70.Buffer], ebx
900
		mov byte[run_file_70+20], 0
949
		mov byte[run_file_70+20], 0
901
		mov dword[run_file_70.FileName], openfile_path
-
 
902
		mov ebx,run_file_70
950
		mov dword[run_file_70.FileName], openfile_path
903
		int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
951
		mcall 70,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
904
		cmp ebx,0xffffffff
952
		cmp ebx,0xffffffff
Line 905... Line 953...
905
		je .end_save_file
953
		je .end_save_file
906
 
954
 
Line 1264... Line 1312...
1264
		popad
1312
		popad
1265
	@@:
1313
	@@:
1266
	ret
1314
	ret
Line 1267... Line 1315...
1267
 
1315
 
-
 
1316
align 4
-
 
1317
but_bru_flip_h:
-
 
1318
	stdcall [buf2d_flip_h],buf_brush
-
 
1319
	call draw_plane
-
 
1320
	ret
-
 
1321
 
-
 
1322
align 4
-
 
1323
but_bru_flip_v:
-
 
1324
	stdcall [buf2d_flip_v],buf_brush
-
 
1325
	call draw_plane
-
 
1326
	ret
-
 
1327
 
-
 
1328
align 4
-
 
1329
but_bru_rot_90:
-
 
1330
	stdcall [buf2d_rotate],buf_brush,90
-
 
1331
	call draw_plane
-
 
1332
	ret
-
 
1333
 
1268
align 4
1334
align 4
1269
but_brush_copy:
1335
but_brush_copy:
1270
	cmp dword[v_pen_mode],PEN_MODE_BRUSH
1336
	cmp dword[v_pen_mode],PEN_MODE_BRUSH
1271
	jne .end_f
1337
	jne .end_f
1272
pushad
1338
pushad
Line 1448... Line 1514...
1448
cam_y dd 0
1514
cam_y dd 0
1449
cam_z dd 0
1515
cam_z dd 0
1450
scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
1516
scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
1451
tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
1517
tile_size dd ? ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
1452
max_open_file_size dd ?
1518
max_open_file_size dd ?
-
 
1519
 
-
 
1520
align 4
-
 
1521
buf_brush: ;¡ãä¥à á ¯à®§à ç­®áâìî ¤«ï ªãàá®à®¢
-
 
1522
	dd brush_data ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
-
 
1523
	dw 0 ;+4 left
-
 
1524
	dw 0 ;+6 top
1453
brush_w dd 5 ;è¨à¨­  ª¨áâ¨
1525
brush_w dd 5 ;è¨à¨­  ª¨áâ¨
1454
brush_h dd 5 ;¢ëá®â  ª¨áâ¨
1526
brush_h dd 5 ;¢ëá®â  ª¨áâ¨
-
 
1527
	dd 0 ;+16 color
-
 
1528
	db 32 ;+20 bit in pixel
-
 
1529
 
1455
brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1530
brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1456
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1531
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1457
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1532
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1458
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1533
dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30
1459
dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
1534
dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31
Line 1467... Line 1542...
1467
txt_brush: db 'Š¨áâì: '
1542
txt_brush: db 'Š¨áâì: '
1468
.size: rb 10
1543
.size: rb 10
1469
txt_mull db '*',0
1544
txt_mull db '*',0
1470
txt_space db ' ',0
1545
txt_space db ' ',0
1471
txt_buf rb 16
1546
txt_buf rb 16
-
 
1547
txt_need_memory db 'Œ «® ¯ ¬ï⨠¤«ï à ¡®âë á ®âªà뢠¥¬ë¬ ä ©«®¬.',13,10,\
-
 
1548
	'à¨ । ªâ¨à®¢ ­¨¨ ä ©«  ¯à®£à ¬¬  ¬®¦¥â § ¢¨á­ãâì.',13,10,\
-
 
1549
	'“¢¥«¨ç⥠ࠧ¬¥à ¯¥à¥¬¥­­®© ',39,'file_size',39,' ¢ ä ©«¥ ',39,'vox_editor.ini',39,'.',0
Line 1472... Line 1550...
1472
 
1550
 
1473
;à¨á®¢ ­¨¥ ¡ãä¥à  á ¢®ªá¥«ì­ë¬¨ ®¡ê¥ªâ ¬¨
1551
;à¨á®¢ ­¨¥ ¡ãä¥à  á ¢®ªá¥«ì­ë¬¨ ®¡ê¥ªâ ¬¨
1474
align 4
1552
align 4
1475
draw_objects:
1553
draw_objects:
Line 1673... Line 1751...
1673
			mcall 37,5,[cursor_pointer]
1751
			mcall 37,5,[cursor_pointer]
1674
	@@:
1752
	@@:
1675
	ret
1753
	ret
1676
endp
1754
endp
Line 1677... Line -...
1677
 
-
 
1678
if 0
-
 
1679
;input:
-
 
1680
; buf - 㪠§ â¥«ì ­  áâபã, ç¨á«® ¤®«¦­® ¡ëâì ¢ 10 ¨«¨ 16 à¨ç­®¬ ¢¨¤¥
-
 
1681
;output:
-
 
1682
; eax - ç¨á«®
-
 
1683
align 4
-
 
1684
proc conv_str_to_int, buf:dword
-
 
1685
	xor eax,eax
-
 
1686
	push ebx ecx esi
-
 
1687
	xor ebx,ebx
-
 
1688
	mov esi,[buf]
-
 
1689
	;®¯à¥¤¥«¥­¨¥ ®âà¨æ â¥«ì­ëå ç¨á¥«
-
 
1690
	xor ecx,ecx
-
 
1691
	inc ecx
-
 
1692
	cmp byte[esi],'-'
-
 
1693
	jne @f
-
 
1694
		dec ecx
-
 
1695
		inc esi
-
 
1696
	@@:
-
 
1697
 
-
 
1698
	cmp word[esi],'0x'
-
 
1699
	je .load_digit_16
-
 
1700
 
-
 
1701
	.load_digit_10: ;áç¨â뢠­¨¥ 10-â¨ç­ëå æ¨äà
-
 
1702
		mov bl,byte[esi]
-
 
1703
		cmp bl,'0'
-
 
1704
		jl @f
-
 
1705
		cmp bl,'9'
-
 
1706
		jg @f
-
 
1707
			sub bl,'0'
-
 
1708
			imul eax,10
-
 
1709
			add eax,ebx
-
 
1710
			inc esi
-
 
1711
			jmp .load_digit_10
-
 
1712
	jmp @f
-
 
1713
 
-
 
1714
	.load_digit_16: ;áç¨â뢠­¨¥ 16-à¨ç­ëå æ¨äà
-
 
1715
		add esi,2
-
 
1716
	.cycle_16:
-
 
1717
		mov bl,byte[esi]
-
 
1718
		cmp bl,'0'
-
 
1719
		jl @f
-
 
1720
		cmp bl,'f'
-
 
1721
		jg @f
-
 
1722
		cmp bl,'9'
-
 
1723
		jle .us1
-
 
1724
			cmp bl,'A'
-
 
1725
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'9' ¨ <'A'
-
 
1726
		.us1: ;á®áâ ¢­®¥ ãá«®¢¨¥
-
 
1727
		cmp bl,'F'
-
 
1728
		jle .us2
-
 
1729
			cmp bl,'a'
-
 
1730
			jl @f ;®âᥨ¢ ¥¬ ᨬ¢®«ë >'F' ¨ <'a'
-
 
1731
			sub bl,32 ;¯¥à¥¢®¤¨¬ ᨬ¢®«ë ¢ ¢¥àå­¨© ॣ¨áâà, ¤«ï ã¯à®é¥­¨ï ¨å ¯®á«¥¤ã饩 ®¡à ¡®âª¨
-
 
1732
		.us2: ;á®áâ ¢­®¥ ãá«®¢¨¥
-
 
1733
			sub bl,'0'
-
 
1734
			cmp bl,9
-
 
1735
			jle .cor1
-
 
1736
				sub bl,7 ;convert 'A' to '10'
-
 
1737
			.cor1:
-
 
1738
			shl eax,4
-
 
1739
			add eax,ebx
-
 
1740
			inc esi
-
 
1741
			jmp .cycle_16
-
 
1742
	@@:
-
 
1743
	cmp ecx,0 ;¥á«¨ ç¨á«® ®âà¨æ â¥«ì­®¥
-
 
1744
	jne @f
-
 
1745
		sub ecx,eax
-
 
1746
		mov eax,ecx
-
 
1747
	@@:
-
 
1748
	pop esi ecx ebx
-
 
1749
	ret
-
 
1750
endp
-
 
1751
end if
-
 
1752
 
-
 
1753
;input:
-
 
1754
; eax = value
-
 
1755
; edi = string buffer
-
 
1756
;output:
-
 
1757
align 4
-
 
1758
convert_int_to_str:
-
 
1759
	pushad
-
 
1760
		mov dword[edi+1],0
-
 
1761
		mov word[edi+5],0
-
 
1762
		call .str
-
 
1763
	popad
-
 
1764
	ret
-
 
1765
 
-
 
1766
align 4
-
 
1767
.str:
-
 
1768
	mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
-
 
1769
    ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®© 
-
 
1770
	cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
-
 
1771
	jb @f
-
 
1772
		xor edx,edx  ;®ç¨áâ¨âì edx
-
 
1773
		div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
-
 
1774
		push edx     ;¯®«®¦¨âì ¢ á⥪
-
 
1775
		;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
-
 
1776
		call .str ;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
-
 
1777
		pop eax
-
 
1778
	@@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
-
 
1779
	or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  祬 ¤¢¥ ¢ëè¥
-
 
1780
	stosb	    ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
-
 
1781
	ret	      ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
-
 
1782
 
-
 
1783
align 4
-
 
1784
proc str_cat, str1:dword, str2:dword
-
 
1785
	push eax ecx edi esi
-
 
1786
	mov esi,dword[str2]
-
 
1787
	stdcall str_len,esi
-
 
1788
	mov ecx,eax
-
 
1789
	inc ecx
-
 
1790
	mov edi,dword[str1]
-
 
1791
	stdcall str_len,edi
-
 
1792
	add edi,eax
-
 
1793
	cld
-
 
1794
	repne movsb
-
 
1795
	pop esi edi ecx eax
-
 
1796
	ret
-
 
1797
endp
-
 
1798
 
-
 
1799
;output:
-
 
1800
; eax = strlen
-
 
1801
align 4
-
 
1802
proc str_len, str1:dword
-
 
1803
	mov eax,[str1]
-
 
1804
	@@:
-
 
1805
		cmp byte[eax],0
-
 
1806
		je @f
-
 
1807
		inc eax
-
 
1808
		jmp @b
-
 
1809
	@@:
-
 
1810
	sub eax,[str1]
-
 
1811
	ret
-
 
1812
endp
-
 
1813
 
1755
 
1814
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1756
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1815
align 4
1757
align 4
1816
OpenDialog_data:
1758
OpenDialog_data:
1817
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
1759
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
Line 1965... Line 1907...
1965
	buf2d_crop_color dd sz_buf2d_crop_color
1907
	buf2d_crop_color dd sz_buf2d_crop_color
1966
	buf2d_offset_h dd sz_buf2d_offset_h
1908
	buf2d_offset_h dd sz_buf2d_offset_h
1967
	buf2d_flood_fill dd sz_buf2d_flood_fill
1909
	buf2d_flood_fill dd sz_buf2d_flood_fill
1968
	buf2d_set_pixel dd sz_buf2d_set_pixel
1910
	buf2d_set_pixel dd sz_buf2d_set_pixel
1969
	buf2d_get_pixel dd sz_buf2d_get_pixel
1911
	buf2d_get_pixel dd sz_buf2d_get_pixel
-
 
1912
	buf2d_flip_h dd sz_buf2d_flip_h
-
 
1913
	buf2d_flip_v dd sz_buf2d_flip_v
-
 
1914
	buf2d_rotate dd sz_buf2d_rotate
1970
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1915
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1971
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1916
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1972
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1917
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1973
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1918
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1974
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
1919
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
Line 2002... Line 1947...
2002
	sz_buf2d_crop_color db 'buf2d_crop_color',0
1947
	sz_buf2d_crop_color db 'buf2d_crop_color',0
2003
	sz_buf2d_offset_h db 'buf2d_offset_h',0
1948
	sz_buf2d_offset_h db 'buf2d_offset_h',0
2004
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1949
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
2005
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1950
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
2006
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1951
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
-
 
1952
	sz_buf2d_flip_h db 'buf2d_flip_h',0
-
 
1953
	sz_buf2d_flip_v db 'buf2d_flip_v',0
-
 
1954
	sz_buf2d_rotate db 'buf2d_rotate',0
2007
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1955
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
2008
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1956
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
2009
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
1957
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
2010
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
1958
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
2011
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
1959
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
Line 2121... Line 2069...
2121
align 4
2069
align 4
2122
buf_vox_g2:
2070
buf_vox_g2:
2123
	db 6,4,0,3 ;w,h,h_osn,n
2071
	db 6,4,0,3 ;w,h,h_osn,n
2124
	rb BUF_STRUCT_SIZE*(3+1)
2072
	rb BUF_STRUCT_SIZE*(3+1)
Line -... Line 2073...
-
 
2073
 
2125
 
2074
align 16
2126
i_end:
2075
i_end:
2127
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
2076
	wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
2128
		rq 0
2077
		rq 0
2129
	rb 4096 ;2048
2078
	rb 4096 ;2048