Subversion Repositories Kolibri OS

Rev

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

Rev 2933 Rev 2974
Line 15... Line 15...
15
include 'mem.inc'
15
include 'mem.inc'
16
include 'dll.inc'
16
include 'dll.inc'
17
include 'vox_draw.inc'
17
include 'vox_draw.inc'
Line 18... Line 18...
18
 
18
 
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
19
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
Line 20... Line 20...
20
caption db 'Voxel editor 23.08.12',0 ;¯®¤¯¨áì ®ª­ 
20
caption db 'Voxel editor 12.09.12',0 ;¯®¤¯¨áì ®ª­ 
21
 
21
 
22
struct FileInfoBlock
22
struct FileInfoBlock
23
	Function dd ?
23
	Function dd ?
Line 32... Line 32...
32
run_file_70 FileInfoBlock
32
run_file_70 FileInfoBlock
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
33
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
Line 34... Line 34...
34
 
34
 
35
fn_toolbar db 'toolbar.png',0
35
fn_toolbar db 'toolbar.png',0
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
36
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*21
37
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*22
38
image_data_toolbar dd 0
38
image_data_toolbar dd 0
39
cursors_count equ 4
39
cursors_count equ 4
Line 40... Line 40...
40
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
40
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
Line 492... Line 492...
492
	mov edx,22
492
	mov edx,22
493
	int 0x40
493
	int 0x40
494
	add ebx,25 shl 16
494
	add ebx,25 shl 16
495
	mov edx,23
495
	mov edx,23
496
	int 0x40
496
	int 0x40
-
 
497
	add ebx,25 shl 16
-
 
498
	mov edx,24
-
 
499
	int 0x40
Line 497... Line 500...
497
 
500
 
498
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
501
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
499
	mov eax,7
502
	mov eax,7
500
	mov ebx,[image_data_toolbar]
503
	mov ebx,[image_data_toolbar]
Line 550... Line 553...
550
	int 0x40
553
	int 0x40
551
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
554
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
552
	add edx,(25 shl 16) ;­ à¨á®¢ âì ª¨áâì
555
	add edx,(25 shl 16) ;­ à¨á®¢ âì ª¨áâì
553
	int 0x40
556
	int 0x40
554
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
557
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
-
 
558
	add edx,(25 shl 16) ;㤠«¨âì ª¨áâì
-
 
559
	int 0x40
-
 
560
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
555
	add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠-1
561
	add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠-1
556
	int 0x40
562
	int 0x40
557
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
563
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
558
	add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠+1
564
	add edx,(25 shl 16) ;è¨à¨­  ª¨á⨠+1
559
	int 0x40
565
	int 0x40
Line 695... Line 701...
695
	jne @f
701
	jne @f
696
		call but_4
702
		call but_4
697
	@@:
703
	@@:
698
	cmp ah,10
704
	cmp ah,10
699
	jne @f
705
	jne @f
700
		call but_5
706
		call but_plane_inc
701
	@@:
707
	@@:
702
	cmp ah,11
708
	cmp ah,11
703
	jne @f
709
	jne @f
704
		call but_6
710
		call but_plane_dec
705
	@@:
711
	@@:
706
	cmp ah,12
712
	cmp ah,12
707
	jne @f
713
	jne @f
708
		call but_mode_pen
714
		call but_mode_pen
709
	@@:
715
	@@:
Line 736... Line 742...
736
	jne @f
742
	jne @f
737
		call but_brush_draw
743
		call but_brush_draw
738
	@@:
744
	@@:
739
	cmp ah,20
745
	cmp ah,20
740
	jne @f
746
	jne @f
741
		call but_bru_w_m
747
		call but_brush_clear
742
	@@:
748
	@@:
743
	cmp ah,21
749
	cmp ah,21
744
	jne @f
750
	jne @f
745
		call but_bru_w_p
751
		call but_bru_w_m
746
	@@:
752
	@@:
747
	cmp ah,22
753
	cmp ah,22
748
	jne @f
754
	jne @f
749
		call but_bru_h_m
755
		call but_bru_w_p
750
	@@:
756
	@@:
751
	cmp ah,23
757
	cmp ah,23
752
	jne @f
758
	jne @f
-
 
759
		call but_bru_h_m
-
 
760
	@@:
-
 
761
	cmp ah,24
-
 
762
	jne @f
753
		call but_bru_h_p
763
		call but_bru_h_p
754
	@@:
764
	@@:
755
	cmp ah,1
765
	cmp ah,1
756
	jne still
766
	jne still
757
.exit:
767
.exit:
Line 767... Line 777...
767
	stdcall [buf2d_delete],buf_curs_8
777
	stdcall [buf2d_delete],buf_curs_8
768
	stdcall mem.Free,[image_data_toolbar]
778
	stdcall mem.Free,[image_data_toolbar]
769
	stdcall mem.Free,[open_file_vox]
779
	stdcall mem.Free,[open_file_vox]
770
	mcall -1
780
	mcall -1
Line -... Line 781...
-
 
781
 
771
 
782
;¤ ­­ë¥ ¤«ï ¨­¨æ¨ «¨§ æ¨¨ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
772
align 4
783
align 4
773
vox_new_data:
784
vox_new_data:
774
	db 2,0,0,0
785
	db 2,0,0,0
775
	db 000b,001b,010b,011b, 100b,101b,110b,111b ;default table
786
	db 0,1,2,3,4,5,6,7 ;default table
Line -... Line 787...
-
 
787
	dd 0 ;null node
776
	dd 0 ;null node
788
 
777
 
789
;¨­¨æ¨ «¨§ æ¨ï ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
778
align 4
790
align 4
779
proc but_new_file uses ecx edi esi
791
proc but_new_file uses ecx edi esi
780
	mov ecx,vox_offs_data+4
792
	mov ecx,vox_offs_data+4
Line 939... Line 951...
939
	call draw_objects
951
	call draw_objects
940
	ret
952
	ret
Line 941... Line 953...
941
 
953
 
942
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
954
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
943
align 4
955
align 4
944
but_5:
956
but_plane_inc:
945
push eax ecx
957
push eax ecx
946
	inc dword[n_plane]
958
	inc dword[n_plane]
947
	mov eax,[v_zoom]
959
	mov eax,[v_zoom]
948
	cmp eax,[scaled_zoom]
960
	cmp eax,[scaled_zoom]
Line 982... Line 994...
982
pop ecx eax
994
pop ecx eax
983
	ret
995
	ret
Line 984... Line 996...
984
 
996
 
985
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
997
;ᤢ¨£ ¥¬ ¯«®áª®áâì á१ 
986
align 4
998
align 4
987
but_6:
999
but_plane_dec:
988
	dec dword[n_plane]
1000
	dec dword[n_plane]
989
	cmp dword[n_plane],0
1001
	cmp dword[n_plane],0
990
	jge .end_f
1002
	jge .end_f
991
push eax ecx
1003
push eax ecx
Line 1306... Line 1318...
1306
		.end_2:
1318
		.end_2:
1307
		inc eax
1319
		inc eax
1308
		add edi,4
1320
		add edi,4
1309
		loop @b
1321
		loop @b
1310
	dec edx
1322
	dec edx
-
 
1323
	sub eax,[brush_w]
-
 
1324
	cmp edx,esi
-
 
1325
	jg .cycle_0
-
 
1326
 
-
 
1327
	call draw_objects
-
 
1328
popad
-
 
1329
	.end_f:
-
 
1330
	ret
-
 
1331
 
-
 
1332
align 4
-
 
1333
but_brush_clear:
-
 
1334
	cmp dword[v_pen_mode],3
-
 
1335
	jne .end_f
-
 
1336
pushad
-
 
1337
	mov eax,[v_cur_x]
-
 
1338
	mov ebx,[n_plane]
-
 
1339
	mov edx,[v_cur_y]
-
 
1340
		
-
 
1341
	mov ecx,[v_zoom]
-
 
1342
	cmp ecx,[scaled_zoom]
-
 
1343
	jle @f
-
 
1344
		;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
-
 
1345
		;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
-
 
1346
		mov ecx,[scaled_zoom]
-
 
1347
 
-
 
1348
		mov edi,[cam_x]
-
 
1349
		shl edi,cl
-
 
1350
		add eax,edi
-
 
1351
		mov edi,[cam_y]
-
 
1352
		shl edi,cl
-
 
1353
		add ebx,edi
-
 
1354
		mov edi,[cam_z]
-
 
1355
		shl edi,cl
-
 
1356
		add edx,edi
-
 
1357
	@@:
-
 
1358
 
-
 
1359
	cld
-
 
1360
	mov edi,brush_data
-
 
1361
	mov esi,edx
-
 
1362
	sub esi,[brush_h]
-
 
1363
	.cycle_0:
-
 
1364
	mov ecx,[brush_w]
-
 
1365
	@@:
-
 
1366
		bt dword[edi],31 ;¡¨â ¯à®§à ç­®áâ¨
-
 
1367
		jc .end_2
-
 
1368
		stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
-
 
1369
		.end_2:
-
 
1370
		inc eax
-
 
1371
		add edi,4
-
 
1372
		loop @b
-
 
1373
	dec edx
1311
	sub eax,[brush_w]
1374
	sub eax,[brush_w]
1312
	cmp edx,esi
1375
	cmp edx,esi
1313
	jg .cycle_0
1376
	jg .cycle_0
Line 1314... Line 1377...
1314
 
1377