Subversion Repositories Kolibri OS

Rev

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

Rev 2748 Rev 2758
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 5.06.12',0 ;¯®¤¯¨áì ®ª­ 
20
caption db 'Voxel editor 11.06.12',0 ;¯®¤¯¨áì ®ª­ 
21
 
21
 
22
struct FileInfoBlock
22
struct FileInfoBlock
23
	Function dd ?
23
	Function dd ?
Line 79... Line 79...
79
	@@:
79
	@@:
80
}
80
}
Line 81... Line 81...
81
 
81
 
82
OT_MAP_X  equ  0
82
OT_MAP_X  equ  0
-
 
83
OT_MAP_Y  equ  0
-
 
84
TILE_SIZE equ 10 ;à §¬¥à ª¢ ¤à â¨ª  ­  ¯«®áª®á⨠á á¥ç¥­¨¥¬
83
OT_MAP_Y  equ  0
85
OT_CAPT_X_COLOR equ  5 ;®âáâ㯠¤«ï ¯®¤¯¨á¨ 梥â 
Line 84... Line 86...
84
TILE_SIZE equ 10
86
OT_CAPT_Y_COLOR equ 30
85
 
87
 
86
align 4
88
align 4
87
start:
89
start:
Line 134... Line 136...
134
 
136
 
135
align 4
137
align 4
136
mouse:
138
mouse:
137
	pushad
139
	pushad
-
 
140
	mcall 37,2
-
 
141
	bt eax,1 ;right button
-
 
142
	jnc @f
-
 
143
		mcall 37,1 ;get mouse coords
-
 
144
		mov ebx,eax
-
 
145
		shr ebx,16
-
 
146
		and eax,0xffff
-
 
147
		stdcall get_buf_color, buf_0
-
 
148
		stdcall get_buf_color, buf_pl
-
 
149
		jmp .end_f
138
	mcall 37,2
150
	@@:
139
	bt eax,0 ;left button
151
	bt eax,0 ;left button
140
	jnc .end_f
152
	jnc .end_f
141
		mcall 37,1 ;get mouse coords
-
 
142
 
153
		mcall 37,1 ;get mouse coords
-
 
154
		mov ebx,eax
143
		mov ebx,eax
155
		shr ebx,16
Line 144... Line 156...
144
		and eax,0xffff
156
		and eax,0xffff
145
 
157
 
146
		cmp dword[v_pen_mode],2 ;select color
158
		cmp dword[v_pen_mode],2 ;select color
147
		jne .end_2
159
		jne .end_2
148
			stdcall get_buf_color, buf_0
160
			stdcall get_buf_color, buf_0
149
			stdcall get_buf_color, buf_pl
161
			stdcall get_buf_color, buf_pl
Line -... Line 162...
-
 
162
			jmp .end_f
-
 
163
		.end_2:
-
 
164
 
-
 
165
 
-
 
166
		push eax ebx
-
 
167
		mov edx,[v_zoom]
-
 
168
		cmp edx,[scaled_zoom]
-
 
169
		jle @f
-
 
170
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
171
		sub edx,[scaled_zoom]
-
 
172
		sub ax,word[buf_0.t]
-
 
173
		sub bx,word[buf_0.l]
-
 
174
		stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx
-
 
175
		cmp eax,0
-
 
176
		je @f
-
 
177
			mov ebx,eax
-
 
178
			and eax,0x3fffffff
-
 
179
			rol ebx,2
-
 
180
			and ebx,3
-
 
181
			dec ebx
-
 
182
 
-
 
183
			shl ebx,2
-
 
184
			add ebx,cam_x
-
 
185
			mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z]
-
 
186
			call draw_objects
-
 
187
 
-
 
188
			pop ebx eax
-
 
189
			jmp .end_f
-
 
190
		@@:
-
 
191
		pop ebx eax
-
 
192
 
150
			jmp .end_f
193
 
151
		.end_2:
194
		;eax - mouse coord y
152
 
195
		;ebx - mouse coord x
153
		movzx edx,word[buf_pl.t]
196
		movzx edx,word[buf_pl.t]
154
		add edx,OT_MAP_Y
197
		add edx,OT_MAP_Y
155
		cmp eax,edx
198
		cmp eax,edx
156
		jl .end_f
199
		jl .end_f
157
			sub eax,edx
200
			sub eax,edx
158
			xor edx,edx
-
 
159
			mov ecx,TILE_SIZE ;H
201
			xor edx,edx
160
			div ecx
202
			mov ecx,TILE_SIZE ;H
161
		shr ebx,16
203
			div ecx
162
		movzx edx,word[buf_pl.l]
204
		movzx edx,word[buf_pl.l]
163
		add edx,OT_MAP_X
205
		add edx,OT_MAP_X
Line 184... Line 226...
184
			mov ecx,TILE_SIZE ;W
226
			mov ecx,TILE_SIZE ;W
185
			div ecx
227
			div ecx
186
			mov [v_cur_x],eax ;X-coord
228
			mov [v_cur_x],eax ;X-coord
Line 187... Line 229...
187
 
229
 
-
 
230
			cmp dword[v_pen_mode],0
-
 
231
			jl .end_1
-
 
232
			cmp dword[v_pen_mode],1
-
 
233
			jg .end_1
-
 
234
				mov eax,[v_cur_x]
-
 
235
				mov ebx,[n_plane]
-
 
236
				mov edx,[v_cur_y]
-
 
237
		
-
 
238
				mov ecx,[v_zoom]
-
 
239
				cmp ecx,[scaled_zoom]
-
 
240
				jle .no_c_coord_0
-
 
241
					;¯à¥®¡à §®¢ ­¨¥ ª®®à¤¨­ â, á ãç¥â®¬ 㢥«¨ç¥­¨ï
-
 
242
					;sub ecx,[scaled_zoom] ;¢ ecx ¯à¨à®áâ ¬ áèâ ¡  (ecx>0)
-
 
243
					mov ecx,[scaled_zoom]
-
 
244
 
-
 
245
					mov edi,[cam_x]
-
 
246
					shl edi,cl
-
 
247
					add eax,edi
-
 
248
					mov edi,[cam_y]
-
 
249
					shl edi,cl
-
 
250
					add ebx,edi
-
 
251
					mov edi,[cam_z]
-
 
252
					shl edi,cl
-
 
253
					add edx,edi
-
 
254
				.no_c_coord_0:
-
 
255
 
-
 
256
				;®â«¨ç î騩áï ¯ à ¬¥âà ¤«ï ä㭪樨 ᮧ¤ ­¨ï ¢®ªá¥«ï
188
			cmp dword[v_pen_mode],0
257
				cmp dword[v_pen_mode],1
189
			jne @f
258
				jne @f
190
			stdcall buf2d_vox_obj_delete_node, [open_file_vox], [v_cur_x],[n_plane],[v_cur_y], [v_zoom]
259
					push dword[v_color]
-
 
260
				@@:
-
 
261
 
-
 
262
				;¢ë§®¢ ®¡é¨å ¯ à ¬¥â஢ ¤«ï ä㭪権
-
 
263
				push dword[v_zoom]
-
 
264
				push edx
-
 
265
				push ebx
-
 
266
				push eax
-
 
267
				push dword[open_file_vox]
-
 
268
 
191
			@@:
269
				;¢ë§®¢ ä㭪権
-
 
270
				cmp dword[v_pen_mode],1
-
 
271
				jne @f
-
 
272
					call buf2d_vox_obj_create_node
192
			cmp dword[v_pen_mode],1
273
					;stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom], [v_color]
-
 
274
					jmp .end_1
-
 
275
				@@:
193
			jne .end_1
276
					call buf2d_vox_obj_delete_node
-
 
277
					;stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom]
194
			stdcall buf2d_vox_obj_create_node, [open_file_vox], [v_cur_x],[n_plane],[v_cur_y], [v_color], [v_zoom]
278
 
195
			.end_1:
279
			.end_1:
196
			call draw_objects
280
			call draw_objects
197
			call draw_pok
281
			call draw_pok
198
	.end_f:
282
	.end_f:
199
	popad
283
	popad
Line -... Line 284...
-
 
284
	ret
-
 
285
 
-
 
286
;input:
200
	ret
287
; eax - coord y
201
 
288
; ebx - coord x
-
 
289
align 4
202
align 4
290
proc get_buf_color, buf:dword
203
proc get_buf_color uses eax ebx edi, buf:dword
291
pushad
204
	mov edi,[buf]
292
	mov edi,[buf]
205
	cmp ax,buf2d_t
293
	cmp ax,buf2d_t
206
	jl .end_f
294
	jl .end_f
207
	sub ax,buf2d_t
295
	sub ax,buf2d_t
208
	cmp eax,buf2d_h
-
 
209
	jg .end_f
296
	cmp eax,buf2d_h
210
	shr ebx,16
297
	jg .end_f
211
	cmp bx,buf2d_l
298
	cmp bx,buf2d_l
212
	jl .end_f
299
	jl .end_f
213
	sub bx,buf2d_l
300
	sub bx,buf2d_l
214
	cmp ebx,buf2d_w
301
	cmp ebx,buf2d_w
215
	jg .end_f
302
	jg .end_f
216
		stdcall [buf2d_get_pixel], edi,ebx,eax
303
		stdcall [buf2d_get_pixel], edi,ebx,eax
217
		mov [v_color],eax
304
		mov [v_color],eax
-
 
305
		;stdcall [buf2d_filled_rect_by_size], buf_0, 5,3, 8,8,eax
-
 
306
		;stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
-
 
307
		mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
-
 
308
		mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
218
		stdcall [buf2d_filled_rect_by_size], buf_0, 5,3, 8,8,eax
309
		mov edx,[v_color]
-
 
310
		mcall 13
219
		stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
311
	.end_f:
220
	.end_f:
312
popad
Line 221... Line 313...
221
	ret
313
	ret
222
endp
314
endp
223
 
315
 
224
;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
316
;¯à¥®¡à §®¢ë¢ ¥¬ ª®®à¤¨­ âã y (§­ ç¥­¨¥ ¤®«¦­® 㢥«¨ç¨¢ âìáï á ­¨§ã ¢¢¥àå)
225
align 4
317
align 4
-
 
318
convert_y:
-
 
319
	push ecx edx
-
 
320
	mov ecx,[v_zoom]
-
 
321
	cmp ecx,[scaled_zoom]
226
convert_y:
322
	jle @f
227
	push ecx edx
323
		mov ecx,[scaled_zoom]
228
	mov ecx,[v_zoom]
324
	@@:
229
	mov edx,1
325
	mov edx,1
230
	cmp ecx,1
326
	cmp ecx,1
231
	jl .end_0
-
 
232
	cld
-
 
233
	@@:
-
 
234
		shl edx,1
327
	jl @f
235
		loop @b
328
		shl edx,cl
236
	.end_0:
329
	@@:
237
	sub edx,eax
330
	sub edx,eax
238
	dec edx
331
	dec edx
Line 245... Line 338...
245
pushad
338
pushad
246
	mcall 12,1
339
	mcall 12,1
Line 247... Line 340...
247
 
340
 
248
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
341
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
249
	xor eax,eax
342
	xor eax,eax
250
	mov ebx,(20 shl 16)+540
343
	mov ebx,(20 shl 16)+550
251
	mov ecx,(20 shl 16)+415
344
	mov ecx,(20 shl 16)+415
252
	mov edx,[sc.work]
345
	mov edx,[sc.work]
253
	or  edx,(3 shl 24)+0x30000000
346
	or  edx,(3 shl 24)+0x30000000
254
	mov edi,caption
347
	mov edi,caption
Line 391... Line 484...
391
	int 0x40 ;
484
	int 0x40 ;
392
	mov ebx,(5 shl 16)
485
	mov ebx,(5 shl 16)
393
	mov ecx,[v_cur_y]
486
	mov ecx,[v_cur_y]
394
	add edx,(6*0)*65536+9
487
	add edx,(6*0)*65536+9
395
	int 0x40 ;
488
	int 0x40 ;
396
 
-
 
397
	mov ebx,(5 shl 16)
489
	mov ebx,(5 shl 16)
398
	mov ecx,[n_plane]
490
	mov ecx,[n_plane]
399
	add edx,(6*0)*65536+9
491
	add edx,(6*0)*65536+9
400
	int 0x40 ;
492
	int 0x40 ;
Line -... Line 493...
-
 
493
 
-
 
494
	mov eax,4 ;à¨á®¢ ­¨¥ ⥪áâ 
-
 
495
	mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2
-
 
496
	mov ecx,[sc.work_text]
-
 
497
	or  ecx,0x80000000 ;or (1 shl 30)
-
 
498
	mov edx,txt_color
-
 
499
	int 0x40
-
 
500
 
-
 
501
	mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;¯® ®á¨ x
-
 
502
	mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;¯® ®á¨ y
-
 
503
	mov edx,[v_color]
401
 
504
	mcall 13
Line 402... Line 505...
402
	ret
505
	ret
403
 
506
 
404
align 4
507
align 4
Line 572... Line 675...
572
 
675
 
573
		.end_save_file:
676
		.end_save_file:
574
	popad
677
	popad
Line -... Line 678...
-
 
678
	ret
575
	ret
679
 
576
 
680
;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
577
align 4
681
align 4
578
but_1:
682
but_1:
579
	cmp dword[v_zoom],7
683
	cmp dword[v_zoom],10 ;¬ ªá¨¬ «ì­ë© à §¬¥à, ¤® ª®â®à®£® ¬®¦­® 㢥«¨ç¨âì 2^10=1024
580
	jge @f
684
	jge @f
-
 
685
		inc dword[v_zoom]
-
 
686
		shl dword[n_plane],1
-
 
687
		push eax
-
 
688
		mov eax,[v_zoom]
-
 
689
		cmp eax,[scaled_zoom]
-
 
690
		jl .end_0
-
 
691
			shl dword[cam_x],1
-
 
692
			shl dword[cam_y],1
-
 
693
			shl dword[cam_z],1
581
		inc dword[v_zoom]
694
		.end_0:
582
		shl dword[n_plane],1
695
		pop eax
583
		call draw_objects
696
		call draw_objects
584
		call draw_pok
697
		call draw_pok
Line -... Line 698...
-
 
698
	@@:
585
	@@:
699
	ret
586
	ret
700
 
587
 
701
;㬥­ì襭¨¥ ¬ áèâ ¡ 
588
align 4
702
align 4
589
but_2:
703
but_2:
590
	cmp dword[v_zoom],-1
704
	cmp dword[v_zoom],-1
-
 
705
	jl @f
-
 
706
		dec dword[v_zoom]
-
 
707
		shr dword[n_plane],1
-
 
708
		push eax
-
 
709
		mov eax,[v_zoom]
-
 
710
		cmp eax,[scaled_zoom]
-
 
711
		jl .end_0
-
 
712
			shr dword[cam_x],1
-
 
713
			shr dword[cam_y],1
591
	jl @f
714
			shr dword[cam_z],1
592
		dec dword[v_zoom]
715
		.end_0:
593
		shr dword[n_plane],1
716
		pop eax
594
		call draw_objects
717
		call draw_objects
Line 688... Line 811...
688
	stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
811
	stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
689
	stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
812
	stdcall [buf2d_clear], buf_r_z, 0 ;ç¨á⨬ ¡ãä¥à
Line 690... Line 813...
690
 
813
 
691
	push eax ebx ecx
814
	push eax ebx ecx
-
 
815
		mov eax,[v_zoom]
-
 
816
		cmp eax,[scaled_zoom]
-
 
817
		jle .end_scaled
-
 
818
			;७¤¥à 㢥«¨ç¥­­®© ç á⨠®¡ê¥ªâ 
-
 
819
			mov ebx,[scaled_zoom]
692
		mov eax,[v_zoom]
820
			sub eax,ebx
-
 
821
			inc ebx
-
 
822
			stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, 0xd080d0
-
 
823
			bt dword[mode_light],0
-
 
824
			jnc @f
-
 
825
				stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
-
 
826
			@@:
-
 
827
			xor ebx,ebx
-
 
828
			xor ecx,ecx
-
 
829
			mov edi,buf_r_img
-
 
830
			stdcall [buf2d_img_hdiv2], edi
-
 
831
			shr buf2d_h,1
-
 
832
			stdcall [buf2d_img_wdiv2], edi
-
 
833
			shr buf2d_w,1
-
 
834
			jmp .show
Line -... Line 835...
-
 
835
		.end_scaled:
693
		inc eax
836
 
694
 
837
		inc eax
695
		stdcall buf2d_vox_obj_draw_3g, buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
838
		stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
696
		bt dword[mode_light],0
839
		bt dword[mode_light],0
697
		jnc @f
840
		jnc @f
Line 698... Line 841...
698
			stdcall buf2d_vox_obj_draw_3g_shadows, buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
841
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
699
		@@:
842
		@@:
700
 
843
 
701
		mov edi,buf_r_img
844
		mov edi,buf_r_img
702
		stdcall [buf2d_img_hdiv2], edi
845
		stdcall [buf2d_img_hdiv2], edi
Line 703... Line 846...
703
		shr buf2d_h,1
846
		shr buf2d_h,1
704
		stdcall [buf2d_img_wdiv2], edi
847
		stdcall [buf2d_img_wdiv2], edi
705
		shr buf2d_w,1
848
		shr buf2d_w,1
706
 
849
 
707
		stdcall buf2d_vox_obj_get_img_w_3g, buf_vox,[v_zoom]
850
		stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
708
		mov ebx,[buf_0.w]
851
		mov ebx,[buf_0.w]
709
		sub ebx,eax
852
		sub ebx,eax
710
		shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
853
		shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
711
		stdcall buf2d_vox_obj_get_img_h_3g, buf_vox,[v_zoom]
854
		stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
712
		cmp eax,[buf_0.h]
855
		cmp eax,[buf_0.h]
713
		jg @f
856
		jg @f
-
 
857
			mov ecx,[buf_0.h]
714
			mov ecx,[buf_0.h]
858
			sub ecx,eax
715
			sub ecx,eax
859
			shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
716
			shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
860
		@@:
717
		@@:		
861
		.show:
718
		stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
862
		stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi
Line 724... Line 868...
724
	ret
868
	ret
Line 725... Line 869...
725
 
869
 
726
align 4
870
align 4
727
draw_palete:
871
draw_palete:
728
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
-
 
729
	stdcall [buf2d_filled_rect_by_size], buf_0, 5,3, 8,8,[v_color]
872
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
730
	stdcall buf2d_draw_palete, buf_0, 5,14, 9,6, 18, 512
873
	stdcall buf2d_draw_palete, buf_0, 5,3, 9,6, 18, 512
731
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
874
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
Line 732... Line 875...
732
	ret
875
	ret
733
 
876
 
734
v_zoom dd 2 ;⥪ã騩 ¬ áèâ ¡
877
v_zoom dd 3 ;⥪ã騩 ¬ áèâ ¡
735
v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
878
v_cur_x dd 0 ;ª®®à¤¨­ â  ªãàá®à  x
736
v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
879
v_cur_y dd 0 ;ª®®à¤¨­ â  ªãàá®à  y (­® ®áì ¢ ®¡ê¥ªâ¥ z)
737
n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
880
n_plane dd 0 ;¯«®áª®áâì á¥ç¥­¨ï
738
v_color dd 0xff ;梥⠪ à ­¤ è 
881
v_color dd 0xff ;梥⠪ à ­¤ è 
-
 
882
v_pen_mode dd 1 ;०¨¬: 0-áâ¨à ­¨ï, 1-à¨á®¢ ­¨ï
-
 
883
mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
-
 
884
cam_x dd 0
-
 
885
cam_y dd 0
Line 739... Line 886...
739
v_pen_mode dd 1 ;०¨¬: 0-áâ¨à ­¨ï, 1-à¨á®¢ ­¨ï
886
cam_z dd 0
740
mode_light dd 1 ;०¨¬ ®á¢¥é¥­¨ï
887
scaled_zoom dd 5 ;¬ áèâ ¡ ¯®á«¥ ª®â®à®£® ­ ç¨­ ¥âáï à¨á®¢ ­¨¥ ç á⨠¨§®¡à ¦¥­¨ï
741
 
888
 
742
txt_zoom db 'Œ áèâ ¡:',0
889
txt_zoom db 'Œ áèâ ¡:',0
-
 
890
txt_cur_x db 'x:',0
Line 743... Line 891...
743
txt_cur_x db 'x:',0
891
txt_cur_y db 'y:',0
744
txt_cur_y db 'y:',0
892
txt_n_plane db '‘¥ç¥­¨¥:',0
745
txt_n_plane db '‘¥ç¥­¨¥:',0
893
txt_color db '–¢¥â:',0
746
 
894
 
Line 754... Line 902...
754
	jne @f
902
	jne @f
755
		call draw_palete
903
		call draw_palete
756
		jmp .end_f
904
		jmp .end_f
757
	@@:
905
	@@:
758
		push eax ebx ecx
906
	push eax ebx ecx
759
		stdcall buf2d_vox_obj_get_img_w_3g, buf_vox,[v_zoom]
907
	stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
760
		mov ebx,[buf_0.w]
908
	mov ebx,[buf_0.w]
761
		sub ebx,eax
909
	sub ebx,eax
762
		shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
910
	shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
Line 763... Line 911...
763
 
911
 
764
		xor ecx,ecx
912
	xor ecx,ecx
765
		stdcall buf2d_vox_obj_get_img_h_3g, buf_vox,[v_zoom]
913
	stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
766
		cmp eax,[buf_0.h]
914
	cmp eax,[buf_0.h]
767
		jg @f
915
	jg @f
768
			mov ecx,[buf_0.h]
916
		mov ecx,[buf_0.h]
769
			sub ecx,eax
917
		sub ecx,eax
770
			shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
918
		shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
Line -... Line 919...
-
 
919
	@@:
-
 
920
 
-
 
921
	mov eax,[v_zoom]
-
 
922
	cmp eax,[scaled_zoom]
771
		@@:
923
	jg @f
-
 
924
		;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
772
 
925
		stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox, [open_file_vox], ebx,ecx, 0, eax
773
		stdcall buf2d_vox_obj_draw_3g, buf_0, buf_0z, buf_vox, [open_file_vox], ebx,ecx, 0, [v_zoom]
926
		stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox], OT_MAP_X,OT_MAP_Y,TILE_SIZE, [v_zoom], [n_plane], 0xd0d0d0
774
		bt dword[mode_light],0
927
		bt dword[mode_light],0
-
 
928
		jnc .end_1
-
 
929
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
775
		jnc @f
930
		.end_1:
-
 
931
		jmp .end_0
776
			stdcall buf2d_vox_obj_draw_3g_shadows, buf_0, buf_0z, buf_vox, ebx,ecx, 0, [v_zoom], 3
932
	@@:
-
 
933
		;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
934
		sub eax,[scaled_zoom]
-
 
935
		stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
-
 
936
			[open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
-
 
937
		stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
-
 
938
			OT_MAP_X,OT_MAP_Y,TILE_SIZE, [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
-
 
939
		bt dword[mode_light],0
-
 
940
		jnc .end_2
777
		@@:
941
			stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
Line 778... Line 942...
778
		pop ecx ebx eax
942
		.end_2:
Line 779... Line 943...
779
	.end_0:
943
	.end_0:
780
 
944
 
781
	stdcall buf2d_vox_obj_draw_pl, buf_pl, [open_file_vox], OT_MAP_X,OT_MAP_Y,TILE_SIZE, [v_zoom], [n_plane], 0xd0d0d0
945
	pop ecx ebx eax
782
 
946
 
Line 1009... Line 1173...
1009
	buf2d_flood_fill dd sz_buf2d_flood_fill
1173
	buf2d_flood_fill dd sz_buf2d_flood_fill
1010
	buf2d_set_pixel dd sz_buf2d_set_pixel
1174
	buf2d_set_pixel dd sz_buf2d_set_pixel
1011
	buf2d_get_pixel dd sz_buf2d_get_pixel
1175
	buf2d_get_pixel dd sz_buf2d_get_pixel
1012
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1176
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1013
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1177
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
-
 
1178
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
-
 
1179
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
-
 
1180
	buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
-
 
1181
	buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
-
 
1182
	buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
-
 
1183
	buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
-
 
1184
	buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
1014
	dd 0,0
1185
	dd 0,0
1015
	sz_init db 'lib_init',0
1186
	sz_init db 'lib_init',0
1016
	sz_buf2d_create db 'buf2d_create',0
1187
	sz_buf2d_create db 'buf2d_create',0
1017
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1188
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1018
	sz_buf2d_clear db 'buf2d_clear',0
1189
	sz_buf2d_clear db 'buf2d_clear',0
Line 1037... Line 1208...
1037
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1208
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1038
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1209
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1039
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1210
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1040
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1211
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1041
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1212
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
-
 
1213
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
-
 
1214
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
-
 
1215
	sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
-
 
1216
	sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
-
 
1217
	sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
-
 
1218
	sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
-
 
1219
	sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
Line 1042... Line 1220...
1042
 
1220
 
1043
mouse_dd dd 0x0
1221
mouse_dd dd 0x0
Line 1044... Line 1222...
1044
sc system_colors 
1222
sc system_colors 
Line 1049... Line 1227...
1049
;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1227
;¡ãä¥à ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1050
align 4
1228
align 4
1051
buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
1229
buf_0: dd 0 ;㪠§ â¥«ì ­  ¤a­ë¥ ¨§®¡à ¦¥­¨ï
1052
.l: dw 5 ;+4 left
1230
.l: dw 5 ;+4 left
1053
.t: dw 45 ;+6 top
1231
.t: dw 45 ;+6 top
1054
.w: dd 192 ;+8 w
1232
.w: dd 192+6 ;+8 w
1055
.h: dd 224 ;+12 h
1233
.h: dd 224+7 ;+12 h
1056
.color: dd 0xffffff ;+16 color
1234
.color: dd 0xffffff ;+16 color
1057
	db 24 ;+20 bit in pixel
1235
	db 24 ;+20 bit in pixel
Line 1058... Line 1236...
1058
 
1236
 
1059
;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1237
;¡ãä¥à £«ã¡¨­ë ®á­®¢­®£® ¨§®¡à ¦¥­¨ï
1060
align 4
1238
align 4
1061
buf_0z: dd 0
1239
buf_0z: dd 0
1062
	dw 0 ;+4 left
1240
	dw 0 ;+4 left
1063
	dw 0 ;+6 top
1241
	dw 0 ;+6 top
1064
.w: dd 192 ;+8 w
1242
.w: dd 192+6 ;+8 w
1065
.h: dd 224 ;+12 h
1243
.h: dd 224+7 ;+12 h
1066
.color: dd 0 ;+16 color
1244
.color: dd 0 ;+16 color
Line 1067... Line 1245...
1067
	db 32 ;+20 bit in pixel
1245
	db 32 ;+20 bit in pixel
1068
 
1246
 
1069
;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
1247
;¡ãä¥à ¤«ï à¨á®¢ ­¨ï á१  ®¡ê¥ªâ 
1070
align 4
1248
align 4
1071
buf_pl: dd 0
1249
buf_pl: dd 0
1072
.l: dw 10+192 ;+4 left
1250
.l: dw 15+192+6 ;+4 left
1073
.t: dw 45 ;+6 top
1251
.t: dw 45 ;+6 top
1074
.w: dd 320 ;+8 w
1252
.w: dd 320 ;+8 w
1075
.h: dd 330 ;+12 h
1253
.h: dd 330 ;+12 h