Subversion Repositories Kolibri OS

Rev

Rev 6259 | Rev 7205 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. use32
  2.         org 0x0
  3.         db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
  4.         dd 1, start, i_end, mem, stacktop, 0, sys_path
  5.  
  6. include '../../../../programs/macros.inc'
  7. include '../../../../programs/proc32.inc'
  8. include '../../../../programs/KOSfuncs.inc'
  9. include '../../../../programs/load_img.inc'
  10. include '../../../../programs/develop/libraries/TinyGL/asm_fork/opengl_const.inc'
  11. include 'vox_3d.inc'
  12. include '../trunk/str.inc'
  13.  
  14. @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
  15. caption db 'Voxel viewer 18.04.17',0 ;¯®¤¯¨áì ®ª­ 
  16.  
  17. 3d_wnd_l equ   5 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  á«¥¢ 
  18. 3d_wnd_t equ  30 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  ᢥàåã
  19. 3d_wnd_w equ 512
  20. 3d_wnd_h equ 512
  21.  
  22. IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
  23. IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*10
  24. image_data_toolbar dd 0
  25.  
  26. offs_zbuf_pbuf equ 24
  27.  
  28. align 4
  29. start:
  30.         load_libraries l_libs_start,l_libs_end
  31.         ;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
  32.         mov     ebp,lib_0
  33.         cmp     dword [ebp+ll_struc_size-4],0
  34.         jz      @f
  35.                 mcall SF_TERMINATE_PROCESS
  36.         @@:
  37.         mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
  38.         mcall SF_SET_EVENTS_MASK,0xC0000027
  39.         stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
  40.  
  41.         stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
  42.  
  43.         load_image_file 'toolbar_t.png', image_data_toolbar,,,6 ;6 - for gray icons
  44.         mov eax,[image_data_toolbar]
  45.         add eax,IMAGE_TOOLBAR_SIZE
  46.         stdcall img_to_gray, [image_data_toolbar],eax,(IMAGE_TOOLBAR_SIZE)/3
  47.  
  48.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  49.         mov [last_time],eax
  50.  
  51.         stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,3d_wnd_w,3d_wnd_h,ctx1
  52.         stdcall [glEnable], GL_DEPTH_TEST
  53.         stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ­®à¬ «¨ ®¤¨­ ª®¢®© ¢¥«¨ç¨­ë ¢® ¨§¡¥¦ ­¨¥  àâ¥ä ªâ®¢
  54.         stdcall [glClearColor], 0.0,0.0,0.0,0.0
  55.         stdcall [glShadeModel], GL_SMOOTH
  56.  
  57.         call but_new_file
  58.  
  59.  
  60. align 4
  61. red_win:
  62.         call draw_window
  63.  
  64. align 4
  65. still:
  66.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  67.         mov ebx,[last_time]
  68.         add ebx,50 ;§ ¤¥à¦ª 
  69.         cmp ebx,eax
  70.         jge @f
  71.                 mov ebx,eax
  72.         @@:
  73.         sub ebx,eax
  74.         mcall SF_WAIT_EVENT_TIMEOUT
  75.         bt word[opt_auto_rotate],0
  76.         jnc @f
  77.                 or eax,eax
  78.                 jz timer_funct
  79.         @@:
  80.  
  81.         cmp al,1
  82.         jz red_win
  83.         cmp al,2
  84.         jz key
  85.         cmp al,3
  86.         jz button
  87.         cmp al,6
  88.         jne @f
  89.                 call mouse
  90.         @@:
  91.  
  92.         jmp still
  93.  
  94. align 4
  95. timer_funct:
  96.         pushad
  97.         mcall SF_SYSTEM_GET,SSF_TIME_COUNT
  98.         mov [last_time],eax
  99.  
  100.         ; ¢â®¬ â¨ç¥áª®¥ ¨§¬¥­¥­¨¥ 㣫  ®¡§®à 
  101.         fld dword[angle_y]
  102.         fsub dword[delt_size]
  103.         fstp dword[angle_y]
  104.         call draw_3d
  105.         stdcall [kosglSwapBuffers]
  106.  
  107.         popad
  108.         jmp still
  109.  
  110. align 4
  111. draw_window:
  112. pushad
  113.         mcall SF_REDRAW,SSF_BEGIN_DRAW
  114.  
  115.         ; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
  116.         mov edx,[sc.work]
  117.         or  edx,(3 shl 24)+0x30000000
  118.         mcall SF_CREATE_WINDOW,(20 shl 16)+800,(20 shl 16)+570,,,caption
  119.  
  120.         ; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
  121.         mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3,[sc.work_button]
  122.  
  123.         mov ebx,(30 shl 16)+20
  124.         mov edx,4
  125.         int 0x40
  126.         add ebx,25 shl 16
  127.         mov edx,5
  128.         int 0x40
  129.         add ebx,30 shl 16
  130.         mov edx,6
  131.         int 0x40
  132.         add ebx,25 shl 16
  133.         mov edx,7
  134.         int 0x40
  135.         add ebx,25 shl 16
  136.         mov edx,8
  137.         int 0x40
  138.         add ebx,25 shl 16
  139.         mov edx,9
  140.         int 0x40
  141.         add ebx,25 shl 16
  142.         mov edx,10
  143.         int 0x40
  144.         add ebx,25 shl 16
  145.         mov edx,11
  146.         int 0x40
  147.         add ebx,25 shl 16
  148.         mov edx,12
  149.         int 0x40
  150.  
  151.         call draw_toolbar_i
  152.  
  153.         stdcall [buf2d_draw], buf_0
  154.         stdcall [kosglSwapBuffers]
  155.  
  156.         mcall SF_REDRAW,SSF_END_DRAW
  157. popad
  158.         ret
  159.  
  160.  
  161. align 4
  162. draw_toolbar_i:
  163.         ; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
  164.         mov edx,(7 shl 16)+7 ;icon new
  165.         mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16
  166.  
  167.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  168.         add edx,(25 shl 16) ;icon open
  169.         int 0x40
  170.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  171.         add edx,(25 shl 16) ;icon save
  172.         int 0x40
  173.  
  174.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  175.         add edx,(30 shl 16) ;zoom +
  176.         int 0x40
  177.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  178.         add edx,(25 shl 16) ;zoom -
  179.         int 0x40
  180.  
  181.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  182.         cmp word[opt_light],0
  183.         jne @f
  184.                 add ebx,IMAGE_TOOLBAR_SIZE ;make gray icon
  185.         @@:
  186.         add edx,(25 shl 16) ;light on/off
  187.         int 0x40
  188.         cmp word[opt_light],0
  189.         jne @f
  190.                 sub ebx,IMAGE_TOOLBAR_SIZE
  191.         @@:
  192.  
  193.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  194.         cmp word[opt_cube_box],0
  195.         jne @f
  196.                 add ebx,IMAGE_TOOLBAR_SIZE ;make gray icon
  197.         @@:
  198.         add edx,(25 shl 16) ;box on/off
  199.         int 0x40
  200.         cmp word[opt_cube_box],0
  201.         jne @f
  202.                 sub ebx,IMAGE_TOOLBAR_SIZE
  203.         @@:
  204.  
  205.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  206.         cmp word[opt_auto_rotate],0
  207.         jne @f
  208.                 add ebx,IMAGE_TOOLBAR_SIZE ;make gray icon
  209.         @@:
  210.         add edx,(25 shl 16) ;auto rotate on/off
  211.         int 0x40
  212.         cmp word[opt_auto_rotate],0
  213.         jne @f
  214.                 sub ebx,IMAGE_TOOLBAR_SIZE
  215.         @@:
  216.  
  217.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  218.         add edx,(25 shl 16) ;info voxels
  219.         int 0x40
  220.         add ebx,IMAGE_TOOLBAR_ICON_SIZE
  221.         add edx,(25 shl 16) ;refresh
  222.         int 0x40
  223.         ret
  224.  
  225.  
  226. align 4
  227. key:
  228.         mcall SF_GET_KEY
  229.  
  230.         cmp ah,178 ;Up
  231.         jne @f
  232.                 fld dword[angle_x]
  233.                 fadd dword[delt_size]
  234.                 fstp dword[angle_x]
  235.                 call draw_3d
  236.                 stdcall [kosglSwapBuffers]
  237.         @@:
  238.         cmp ah,177 ;Down
  239.         jne @f
  240.                 fld dword[angle_x]
  241.                 fsub dword[delt_size]
  242.                 fstp dword[angle_x]
  243.                 call draw_3d
  244.                 stdcall [kosglSwapBuffers]
  245.         @@:
  246.         cmp ah,176 ;Left
  247.         jne @f
  248.                 fld dword[angle_y]
  249.                 fadd dword[delt_size]
  250.                 fstp dword[angle_y]
  251.                 call draw_3d
  252.                 stdcall [kosglSwapBuffers]
  253.         @@:
  254.         cmp ah,179 ;Right
  255.         jne @f
  256.                 fld dword[angle_y]
  257.                 fsub dword[delt_size]
  258.                 fstp dword[angle_y]
  259.                 call draw_3d
  260.                 stdcall [kosglSwapBuffers]
  261.         @@:
  262.  
  263.         jmp still
  264.  
  265.  
  266. align 4
  267. mouse:
  268.         push eax ebx
  269.         mcall SF_MOUSE_GET,SSF_BUTTON_EXT
  270.         bt eax,0
  271.         jnc .end_m
  272.                 ;mouse l. but. move
  273.                 cmp dword[mouse_drag],1
  274.                 jne .end_m
  275.                 mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  276.                 mov ebx,eax
  277.                 shr ebx,16 ;mouse.x
  278.                 cmp ebx,3d_wnd_l
  279.                 jg @f
  280.                         mov ebx,3d_wnd_l
  281.                 @@:
  282.                 sub ebx,3d_wnd_l
  283.                 cmp ebx,3d_wnd_w
  284.                 jle @f
  285.                         mov ebx,3d_wnd_w
  286.                 @@:
  287.                 and eax,0xffff ;mouse.y
  288.                 cmp eax,3d_wnd_t
  289.                 jg @f
  290.                         mov eax,3d_wnd_t
  291.                 @@:
  292.                 sub eax,3d_wnd_t
  293.                 cmp eax,3d_wnd_h
  294.                 jle @f
  295.                         mov eax,3d_wnd_h
  296.                 @@:
  297.                 finit
  298.                 fild dword[mouse_y]
  299.                 mov [mouse_y],eax
  300.                 fisub dword[mouse_y]
  301.                 fdiv dword[angle_dxm] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ y (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ x
  302.                 fadd dword[angle_x]
  303.                 fstp dword[angle_x]
  304.  
  305.                 fild dword[mouse_x]
  306.                 mov [mouse_x],ebx
  307.                 fisub dword[mouse_x]
  308.                 fdiv dword[angle_dym] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ x (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ y
  309.                 fadd dword[angle_y]
  310.                 fstp dword[angle_y]
  311.  
  312.                 call draw_3d
  313.                 stdcall [kosglSwapBuffers]
  314.                 jmp .end_d
  315.         .end_m:
  316.         bt eax,16
  317.         jnc @f
  318.                 ;mouse l. but. up
  319.                 mov dword[mouse_drag],0
  320.                 jmp .end_d
  321.         @@:
  322.         bt eax,8
  323.         jnc .end_d
  324.                 ;mouse l. but. press
  325.                 mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
  326.                 mov ebx,eax
  327.                 shr ebx,16 ;mouse.x
  328.                 cmp ebx,3d_wnd_l
  329.                 jl .end_d
  330.                 sub ebx,3d_wnd_l
  331.                 cmp ebx,3d_wnd_w
  332.                 jg .end_d
  333.                 and eax,0xffff ;mouse.y
  334.                 cmp eax,3d_wnd_t
  335.                 jl .end_d
  336.                 sub eax,3d_wnd_t
  337.                 cmp eax,3d_wnd_h
  338.                 jg .end_d
  339.                 mov dword[mouse_drag],1
  340.                 mov dword[mouse_x],ebx
  341.                 mov dword[mouse_y],eax
  342.         .end_d:
  343.  
  344.         ;stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
  345.         pop ebx eax
  346.         ret
  347.  
  348. align 4
  349. button:
  350.         mcall SF_GET_BUTTON
  351.         cmp ah,3
  352.         jne @f
  353.                 call but_new_file
  354.         @@:
  355.         cmp ah,4
  356.         jne @f
  357.                 call but_open_file
  358.         @@:
  359.         cmp ah,5
  360.         jne @f
  361.                 call but_save_file
  362.         @@:
  363.         cmp ah,6
  364.         jne @f
  365.                 call but_zoom_p
  366.         @@:
  367.         cmp ah,7
  368.         jne @f
  369.                 call but_zoom_m
  370.         @@:
  371.         cmp ah,8
  372.         jne @f
  373.                 call but_3
  374.         @@:
  375.         cmp ah,9
  376.         jne @f
  377.                 call but_4
  378.         @@:
  379.         cmp ah,10
  380.         jne @f
  381.                 call but_5
  382.         @@:
  383.         cmp ah,11
  384.         jne @f
  385.                 call but_6
  386.         @@:
  387.         cmp ah,12
  388.         jne @f
  389.                 call but_draw_cadr
  390.         @@:
  391.         cmp ah,1
  392.         jne still
  393. .exit:
  394.         stdcall [buf2d_delete],buf_0
  395.         stdcall mem.Free,[image_data_toolbar]
  396.         stdcall mem.Free,[open_file_data]
  397.         stdcall mem.Free,[open_file_ogl]
  398.         mcall SF_TERMINATE_PROCESS
  399.  
  400.  
  401. align 4
  402. but_new_file:
  403.         mov dword[angle_x], -30.0
  404.         mov dword[angle_y], 180.0
  405.         mov dword[angle_z], 180.0
  406.         ret
  407.  
  408. align 4
  409. open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
  410. open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
  411. open_file_ogl dd 0 ;¤«ï § ¯¨á¨ ª®®à¤¨­ â èà ­¥© ¢®ªá¥«¥© ¢ ¯®ª §¥ opengl
  412. v_zoom dd 0
  413.  
  414. align 4
  415. but_open_file:
  416. pushad
  417.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  418.         mov [OpenDialog_data.type],0
  419.         stdcall [OpenDialog_Start],OpenDialog_data
  420.         cmp [OpenDialog_data.status],2
  421.         je .end_open_file
  422.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  423.  
  424.         mov [run_file_70.Function], SSF_GET_INFO
  425.         mov [run_file_70.Position], 0
  426.         mov [run_file_70.Flags], 0
  427.         mov dword[run_file_70.Count], 0
  428.         mov dword[run_file_70.Buffer], open_b
  429.         mov byte[run_file_70+20], 0
  430.         mov dword[run_file_70.FileName], openfile_path
  431.         mcall SF_FILE,run_file_70
  432.  
  433.         ;mov eax,dword[open_b+32]
  434.         ;mov edi,txt_buf
  435.         ;call conv_int_to_str
  436.         ;notify_window_run txt_buf
  437.  
  438.         mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
  439.         stdcall mem.ReAlloc,[open_file_data],ecx
  440.         mov [open_file_data],eax
  441.        
  442.         mov [run_file_70.Function], SSF_READ_FILE
  443.         mov [run_file_70.Position], 0
  444.         mov [run_file_70.Flags], 0
  445.         mov dword[run_file_70.Count], ecx
  446.         m2m dword[run_file_70.Buffer], dword[open_file_data]
  447.         mov byte[run_file_70+20], 0
  448.         mov dword[run_file_70.FileName], openfile_path
  449.         mcall SF_FILE,run_file_70
  450.         cmp ebx,0xffffffff
  451.         je .end_open_file
  452.  
  453.         mov [open_file_size],ebx
  454.         mcall SF_SET_CAPTION,1,openfile_path
  455.  
  456.         mov eax,[open_file_data]
  457.         movzx eax,byte[eax]
  458.         mov dword[v_zoom],eax ;¡¥à¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
  459.         mov ecx,[open_file_size]
  460.         sub ecx,vox_offs_data
  461.         shr ecx,2
  462.         imul ecx,vox_ogl_size
  463.         add ecx,4 ;ecx = à §¬¥à ¯ ¬ï⨠­¥®¡å®¤¨¬®© ¤«ï à á¯ ª®¢ª¨ ª®®à¤¨­ â
  464.         stdcall mem.ReAlloc,[open_file_ogl],ecx
  465.         or eax,eax
  466.         jz .end_open_file
  467.                 mov [open_file_ogl],eax
  468.                 stdcall buf_vox_obj_create_3d,[open_file_data],eax,0,0,[v_zoom]
  469.                 call draw_cadr_8
  470.         .end_open_file:
  471. popad
  472.         ret
  473.  
  474. ;description:
  475. ; à¨á®¢ ­¨¥ 8-¬¨ ª ¤à®¢ ¯®¤ à §­ë¬¨ 㣫 ¬¨ ¯®¢®à®â 
  476. align 4
  477. draw_cadr_8:
  478.         call but_new_file ;ãáâ ­®¢ª  㣫®¢ ¯®¢®à®â  ¯® 㬮«ç ­¨î
  479.         stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
  480.  
  481.         ;à¨á®¢ ­¨¥ 8-¬¨ ª ¤à®¢
  482.         fild dword[rot_angles+4]
  483.         fstp dword[angle_y]
  484.         call draw_3d
  485.         call draw_cadr
  486.         stdcall [buf2d_bit_blt], buf_0, 128, 0, buf_1
  487.  
  488.         fild dword[rot_angles+8]
  489.         fstp dword[angle_y]
  490.         call draw_3d
  491.         call draw_cadr
  492.         stdcall [buf2d_bit_blt], buf_0, 0, 128, buf_1
  493.        
  494.         fild dword[rot_angles+12]
  495.         fstp dword[angle_y]
  496.         call draw_3d
  497.         call draw_cadr
  498.         stdcall [buf2d_bit_blt], buf_0, 128, 128, buf_1
  499.  
  500.         fild dword[rot_angles+16]
  501.         fstp dword[angle_y]
  502.         call draw_3d
  503.         call draw_cadr
  504.         stdcall [buf2d_bit_blt], buf_0, 0, 256, buf_1
  505.        
  506.         fild dword[rot_angles+20]
  507.         fstp dword[angle_y]
  508.         call draw_3d
  509.         call draw_cadr
  510.         stdcall [buf2d_bit_blt], buf_0, 128, 256, buf_1
  511.  
  512.         fild dword[rot_angles+24]
  513.         fstp dword[angle_y]
  514.         call draw_3d
  515.         call draw_cadr
  516.         stdcall [buf2d_bit_blt], buf_0, 0, 384, buf_1
  517.        
  518.         fild dword[rot_angles+28]
  519.         fstp dword[angle_y]
  520.         call draw_3d
  521.         call draw_cadr
  522.         stdcall [buf2d_bit_blt], buf_0, 128, 384, buf_1
  523.  
  524.         ; *** ¯®á«¥¤­¨© ª ¤à ***
  525.         fild dword[rot_angles]
  526.         fstp dword[angle_y]
  527.         call draw_3d
  528.         call draw_cadr
  529.         stdcall [buf2d_bit_blt], buf_0, 0, 0, buf_1
  530.        
  531.         call draw_3d
  532.         ; ***
  533.  
  534.         stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
  535.         ret
  536.  
  537. align 4
  538. rot_angles dd 180,225,270,315,0,45,90,135
  539.  
  540. align 4
  541. draw_cadr:
  542.         mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
  543.         mov eax,[eax] ;eax -> ZBuffer
  544.         mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
  545.         mov dword[buf_1],eax
  546.  
  547.         mov dword[buf_1.w],512
  548.         mov dword[buf_1.h],512
  549.         stdcall [buf2d_img_hdiv2],buf_1
  550.         mov dword[buf_1.h],256
  551.         stdcall [buf2d_img_hdiv2],buf_1
  552.         mov dword[buf_1.h],128
  553.         stdcall [buf2d_img_wdiv2],buf_1
  554.         mov dword[buf_1.w],256
  555.         stdcall [buf2d_img_wdiv2],buf_1
  556.         mov dword[buf_1.w],128
  557.         ret
  558.  
  559. align 4
  560. but_save_file:
  561.         pushad
  562.         copy_path open_dialog_name,communication_area_default_path,file_name,0
  563.         mov [OpenDialog_data.type],1
  564.         stdcall [OpenDialog_Start],OpenDialog_data
  565.         cmp [OpenDialog_data.status],2
  566.         je .end_save_file
  567.         ;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
  568.  
  569.         mov [run_file_70.Function], SSF_CREATE_FILE
  570.         mov [run_file_70.Position], 0
  571.         mov [run_file_70.Flags], 0
  572.         mov ebx, dword[open_file_data]
  573.         ;¯¨è¥¬ ¢ ä ©« ­®¢ë© ¬ áèâ ¡
  574.         mov edx,dword[v_zoom]
  575.         mov byte[ebx],dl
  576.         mov [run_file_70.Buffer], ebx
  577.         mov ebx,[open_file_size]
  578.         mov dword[run_file_70.Count], ebx ;à §¬¥à ä ©« 
  579.         mov byte[run_file_70+20], 0
  580.         mov dword[run_file_70.FileName], openfile_path
  581.         mcall SF_FILE,run_file_70
  582.         ;cmp ebx,0xffffffff
  583.         ;je .end_save_file
  584.         ; ... á®®¡é¥­¨¥ ® ­¥ã¤ ç­®¬ á®åà ­¥­¨¨ ...
  585.  
  586.         .end_save_file:
  587.         popad
  588.         ret
  589.  
  590. align 4
  591. proc but_zoom_p uses eax
  592.     cmp dword[v_zoom],11 ;max=2^11=2048
  593.     jge @f
  594.         inc dword[v_zoom]
  595.         stdcall buf_vox_obj_create_3d,[open_file_data],[open_file_ogl],0,0,[v_zoom]
  596.                 call draw_3d
  597.                 stdcall [kosglSwapBuffers]
  598.     @@:
  599.     ret
  600. endp
  601.  
  602. align 4
  603. proc but_zoom_m uses eax
  604.     cmp dword[v_zoom],1
  605.     jle @f
  606.         dec dword[v_zoom]
  607.         stdcall buf_vox_obj_create_3d,[open_file_data],[open_file_ogl],0,0,[v_zoom]
  608.                 call draw_3d
  609.                 stdcall [kosglSwapBuffers]
  610.     @@:
  611.     ret
  612. endp
  613.  
  614. align 4
  615. proc but_3 uses eax ebx ecx edx
  616.         xor word[opt_light],1
  617.         cmp word[opt_light],0
  618.         je @f
  619.                 stdcall [glEnable], GL_LIGHTING
  620.                 stdcall [glEnable], GL_LIGHT0
  621.                 jmp .end_light
  622.         @@:
  623.                 stdcall [glDisable], GL_LIGHTING
  624.                 stdcall [glDisable], GL_LIGHT0
  625.         .end_light:
  626.         call draw_toolbar_i
  627.         call draw_3d
  628.         stdcall [kosglSwapBuffers]
  629.         ret
  630. endp
  631.  
  632. align 4
  633. proc but_4 uses eax ebx ecx edx
  634.         xor word[opt_cube_box],1
  635.         call draw_toolbar_i
  636.         call draw_3d
  637.         stdcall [kosglSwapBuffers]
  638.         ret
  639. endp
  640.  
  641. align 4
  642. proc but_5 uses eax ebx ecx edx
  643.         xor word[opt_auto_rotate],1
  644.         call draw_toolbar_i
  645.         ret
  646. endp
  647.  
  648. align 4
  649. proc but_6 uses eax ebx ecx edx edi
  650.         ;¢ëç¨á«¥­¨¥ áâ â¨á⨪¨ ¯® ¢®ªá¥«ï¬
  651.         mov eax,[open_file_ogl]
  652.         or eax,eax
  653.         jz .end_stat
  654.                 mov ebx,[eax]
  655.                 mov ecx,ebx
  656.                 mov edx,ebx
  657.                 imul ebx,6
  658.                 add eax,4
  659. align 4
  660.                 .cycle_0:
  661.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_z0
  662.                         jc @f
  663.                         dec ebx
  664.                         @@:
  665.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_z1
  666.                         jc @f
  667.                         dec ebx
  668.                         @@:
  669.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_y0
  670.                         jc @f
  671.                         dec ebx
  672.                         @@:
  673.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_y1
  674.                         jc @f
  675.                         dec ebx
  676.                         @@:
  677.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_x0
  678.                         jc @f
  679.                         dec ebx
  680.                         @@:
  681.                         bt word[eax+vox_ogl_planes],vox_ogl_gran_x1
  682.                         jc @f
  683.                         dec ebx
  684.                         @@:
  685.                         add eax,vox_ogl_size
  686.                 loop .cycle_0
  687.  
  688.                 mov eax,edx
  689.                 mov edi,txt_stat_m1.v
  690.                 stdcall convert_int_to_str,20
  691.  
  692.                 mov eax,ebx
  693.                 mov edi,txt_stat_m2.v
  694.                 stdcall convert_int_to_str,20
  695.  
  696.                 stdcall str_n_cat,txt_stat_m1.v,txt_stat_m2,50
  697.                 notify_window_run txt_stat_m1
  698.         .end_stat:
  699.         ret
  700. endp
  701.  
  702. align 4
  703. txt_stat_m1:
  704.         db '‘â â¨á⨪ ',13,10,'‚®ªá¥«¥©: '
  705. .v: rb 70
  706. txt_stat_m2:
  707.         db 13,10,'Žâ®¡à ¦ ¥¬ëå £à ­¥©: '
  708. .v: rb 20
  709.  
  710. align 4
  711. proc but_draw_cadr uses eax ebx ecx edx
  712.         mov ebx,[angle_x]
  713.         mov ecx,[angle_y]
  714.         mov edx,[angle_z]
  715.         call draw_cadr_8
  716.         mov [angle_x],ebx
  717.         mov [angle_y],ecx
  718.         mov [angle_z],edx
  719.         cmp word[opt_auto_rotate],0
  720.         jne @f
  721.                 call draw_3d
  722.                 ;stdcall [kosglSwapBuffers]
  723.         @@:
  724.         ret
  725. endp
  726.  
  727. align 4
  728. draw_3d:
  729.         stdcall [glClear], GL_COLOR_BUFFER_BIT + GL_DEPTH_BUFFER_BIT ;®ç¨á⨬ ¡ãä¥à æ¢¥â  ¨ £«ã¡¨­ë
  730.         stdcall [glPushMatrix]
  731.  
  732.         cmp word[opt_light],0
  733.         je @f
  734.                 call SetLight
  735.         @@:
  736.         stdcall [glTranslatef], 0.0,0.0,0.5 ;ª®®à¤¨­ âë ¯® ®á¨ z ¤®«¦­ë ¡ëâì ¢ ¯à¥¤¥« å ®â 0.0 ¤® 1.0, ¨­ ç¥ ¨§®¡à ¦¥­¨¥ ¡ã¤¥â ®âᥪ âìáï
  737.                 ;¢®ªá¥«ì­ë© ®¡ê¥ªâ ¨¬¥¥â ª®®à¤¨­ âë ¯® ®áï¬ ®â -0.5 ¤® 0.5, ¯®â®¬ã ¥£® ¤¢¨£ ¥¬ ­  +0.5
  738.                 ;­® ¢á¥ ¦¥ ¯à¨ ¯®¢®à®â å ¡ã¤ãâ ®âᥪ âáï ªà ï, ª®â®àë¥ ¢ë«¥§ãâ §  ¯à¥¤¥«ë ¯«®áª®á⥩ ®âá¥ç¥­¨ï
  739.                 ;¢ ¢¥àᨨ opengl ¯®¤ Win ª®®à¤¨­ âë ¨¤ãâ ®â -1.0 ¤® 1.0 ¯®â®¬ã â ¬ í⮣® ¤¥« âì ­¥ ­ã¦­®
  740.         stdcall [glScalef], [scale], [scale], [scale] ;㢥«¨ç¨¢ ¥¬ ¢®ªá¥«ì­ë© ®¡ê¥ªâ, çâ®-¡ë ­¥ ¡ë« ®ç¥­ì ¬ «¥­ìª¨¬
  741.         stdcall [glScalef], 1.0, 1.0, 0.25 ;çâ®-¡ë ªà ï ®¡ê¥ªâ  ­¥ ¢ë« §¨«¨ §  £à ­¨ ®âá¥ç¥­¨ï
  742.         stdcall [glRotatef], [angle_x],1.0,0.0,0.0
  743.         stdcall [glRotatef], [angle_y],0.0,1.0,0.0
  744.         stdcall [glRotatef], [angle_z],0.0,0.0,1.0
  745.         stdcall draw_voxels_3d,[open_file_ogl]
  746.  
  747.         stdcall [glPopMatrix]
  748. ret
  749.  
  750. align 4
  751. proc SetLight
  752.     stdcall [glLightfv], GL_LIGHT0, GL_POSITION, light_position
  753.     stdcall [glLightfv], GL_LIGHT0, GL_SPOT_DIRECTION, light_dir
  754.  
  755.     stdcall [glLightfv], GL_LIGHT0, GL_DIFFUSE, white_light
  756.     stdcall [glLightfv], GL_LIGHT0, GL_SPECULAR, white_light
  757.  
  758.     stdcall [glEnable], GL_COLOR_MATERIAL
  759.     stdcall [glColorMaterial], GL_FRONT, GL_AMBIENT_AND_DIFFUSE
  760.     stdcall [glMaterialfv], GL_FRONT, GL_SPECULAR, mat_specular
  761.     stdcall [glMaterialf], GL_FRONT, GL_SHININESS, mat_shininess
  762.     stdcall [glLightModelfv], GL_LIGHT_MODEL_AMBIENT, lmodel_ambient
  763.  
  764.     stdcall [glEnable], GL_LIGHTING
  765.     stdcall [glEnable], GL_LIGHT0
  766.    
  767.     ;;;stdcall [glLightModeli], GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE
  768.     ret
  769. endp
  770.  
  771. align 4
  772. proc img_to_gray, buf_rgb:dword, buf_g24:dword, pixels:dword
  773. pushad
  774.         mov esi,[buf_rgb]
  775.         mov edi,[buf_g24]
  776.         mov ecx,[pixels]
  777.         mov ebx,3
  778. align 4
  779.         @@:
  780.                 movzx eax,byte[esi]
  781.                 movzx edx,byte[esi+1]
  782.                 add eax,edx
  783.                 movzx edx,byte[esi+2]
  784.                 add eax,edx
  785.                 xor edx,edx
  786.                 div ebx ;shr eax,2
  787.                 mov ah,al
  788.                 mov word[edi],ax
  789.                 mov byte[edi+2],al
  790.                 add esi,3
  791.                 add edi,3
  792.                 loop @b
  793. popad
  794.         ret
  795. endp
  796.  
  797.  
  798. ;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
  799. align 4
  800. OpenDialog_data:
  801. .type                   dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
  802. .procinfo               dd procinfo     ;+4
  803. .com_area_name          dd communication_area_name      ;+8
  804. .com_area               dd 0    ;+12
  805. .opendir_path           dd plugin_path  ;+16
  806. .dir_default_path       dd default_dir ;+20
  807. .start_path             dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
  808. .draw_window            dd draw_window  ;+28
  809. .status                 dd 0    ;+32
  810. .openfile_path          dd openfile_path        ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
  811. .filename_area          dd filename_area        ;+40
  812. .filter_area            dd Filter
  813. .x:
  814. .x_size                 dw 420 ;+48 ; Window X size
  815. .x_start                dw 10 ;+50 ; Window X position
  816. .y:
  817. .y_size                 dw 320 ;+52 ; Window y size
  818. .y_start                dw 10 ;+54 ; Window Y position
  819.  
  820. default_dir db '/rd/1',0
  821.  
  822. communication_area_name:
  823.         db 'FFFFFFFF_open_dialog',0
  824. open_dialog_name:
  825.         db 'opendial',0
  826. communication_area_default_path:
  827.         db '/rd/1/File managers/',0
  828.  
  829. Filter:
  830. dd Filter.end - Filter ;.1
  831. .1:
  832. db 'VOX',0
  833. db 'TXT',0
  834. .end:
  835. db 0
  836.  
  837.  
  838.  
  839. head_f_i:
  840. head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
  841.  
  842. system_dir_0 db '/sys/lib/'
  843. lib_name_0 db 'proc_lib.obj',0
  844. err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
  845. err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
  846.  
  847. system_dir_1 db '/sys/lib/'
  848. lib_name_1 db 'libimg.obj',0
  849. err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
  850. err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
  851.  
  852. system_dir_2 db '/sys/lib/'
  853. lib_name_2 db 'buf2d.obj',0
  854. err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
  855. err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
  856.  
  857. system_dir_3 db '/sys/lib/'
  858. lib_name_3 db 'tinygl.obj',0
  859. err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'tinygl.obj',39,0
  860. err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'tinygl',39,0
  861.  
  862. l_libs_start:
  863.         lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
  864.                 err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
  865.         lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
  866.                 err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
  867.         lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
  868.                 err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
  869.         lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
  870.                 err_msg_found_lib_3,head_f_l,import_lib_tinygl,err_msg_import_3,head_f_i
  871. l_libs_end:
  872.  
  873. align 4
  874. import_libimg:
  875.         dd alib_init1
  876.         img_is_img  dd aimg_is_img
  877.         img_info    dd aimg_info
  878.         img_from_file dd aimg_from_file
  879.         img_to_file dd aimg_to_file
  880.         img_from_rgb dd aimg_from_rgb
  881.         img_to_rgb  dd aimg_to_rgb
  882.         img_to_rgb2 dd aimg_to_rgb2
  883.         img_decode  dd aimg_decode
  884.         img_encode  dd aimg_encode
  885.         img_create  dd aimg_create
  886.         img_destroy dd aimg_destroy
  887.         img_destroy_layer dd aimg_destroy_layer
  888.         img_count   dd aimg_count
  889.         img_lock_bits dd aimg_lock_bits
  890.         img_unlock_bits dd aimg_unlock_bits
  891.         img_flip    dd aimg_flip
  892.         img_flip_layer dd aimg_flip_layer
  893.         img_rotate  dd aimg_rotate
  894.         img_rotate_layer dd aimg_rotate_layer
  895.         img_draw    dd aimg_draw
  896.  
  897.         dd 0,0
  898.         alib_init1   db 'lib_init',0
  899.         aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
  900.         aimg_info    db 'img_info',0
  901.         aimg_from_file db 'img_from_file',0
  902.         aimg_to_file db 'img_to_file',0
  903.         aimg_from_rgb db 'img_from_rgb',0
  904.         aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
  905.         aimg_to_rgb2 db 'img_to_rgb2',0
  906.         aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
  907.         aimg_encode  db 'img_encode',0
  908.         aimg_create  db 'img_create',0
  909.         aimg_destroy db 'img_destroy',0
  910.         aimg_destroy_layer db 'img_destroy_layer',0
  911.         aimg_count   db 'img_count',0
  912.         aimg_lock_bits db 'img_lock_bits',0
  913.         aimg_unlock_bits db 'img_unlock_bits',0
  914.         aimg_flip    db 'img_flip',0
  915.         aimg_flip_layer db 'img_flip_layer',0
  916.         aimg_rotate  db 'img_rotate',0
  917.         aimg_rotate_layer db 'img_rotate_layer',0
  918.         aimg_draw    db 'img_draw',0
  919.  
  920. align 4
  921. proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
  922.         OpenDialog_Init dd aOpenDialog_Init
  923.         OpenDialog_Start dd aOpenDialog_Start
  924. dd 0,0
  925.         aOpenDialog_Init db 'OpenDialog_init',0
  926.         aOpenDialog_Start db 'OpenDialog_start',0
  927.  
  928. align 4
  929. import_buf2d:
  930.         init dd sz_init
  931.         buf2d_create dd sz_buf2d_create
  932.         buf2d_create_f_img dd sz_buf2d_create_f_img
  933.         buf2d_clear dd sz_buf2d_clear
  934.         buf2d_draw dd sz_buf2d_draw
  935.         buf2d_delete dd sz_buf2d_delete
  936.         buf2d_line dd sz_buf2d_line
  937.         buf2d_rect_by_size dd sz_buf2d_rect_by_size
  938.         buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
  939.         buf2d_circle dd sz_buf2d_circle
  940.         buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
  941.         buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
  942.         buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
  943.         buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
  944.         buf2d_bit_blt dd sz_buf2d_bit_blt
  945.         buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
  946.         buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
  947.         buf2d_curve_bezier dd sz_buf2d_curve_bezier
  948.         buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
  949.         buf2d_draw_text dd sz_buf2d_draw_text
  950.         buf2d_crop_color dd sz_buf2d_crop_color
  951.         buf2d_offset_h dd sz_buf2d_offset_h
  952.         buf2d_flood_fill dd sz_buf2d_flood_fill
  953.         buf2d_set_pixel dd sz_buf2d_set_pixel
  954.         dd 0,0
  955.         sz_init db 'lib_init',0
  956.         sz_buf2d_create db 'buf2d_create',0
  957.         sz_buf2d_create_f_img db 'buf2d_create_f_img',0
  958.         sz_buf2d_clear db 'buf2d_clear',0
  959.         sz_buf2d_draw db 'buf2d_draw',0
  960.         sz_buf2d_delete db 'buf2d_delete',0
  961.         sz_buf2d_line db 'buf2d_line',0
  962.         sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
  963.         sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
  964.         sz_buf2d_circle db 'buf2d_circle',0
  965.         sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
  966.         sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
  967.         sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
  968.         sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
  969.         sz_buf2d_bit_blt db 'buf2d_bit_blt',0
  970.         sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
  971.         sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
  972.         sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
  973.         sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
  974.         sz_buf2d_draw_text db 'buf2d_draw_text',0
  975.         sz_buf2d_crop_color db 'buf2d_crop_color',0
  976.         sz_buf2d_offset_h db 'buf2d_offset_h',0
  977.         sz_buf2d_flood_fill db 'buf2d_flood_fill',0
  978.         sz_buf2d_set_pixel db 'buf2d_set_pixel',0
  979.  
  980. ;--------------------------------------------------
  981. align 4
  982. import_lib_tinygl:
  983.  
  984. macro E_LIB n
  985. {
  986.         n dd sz_#n
  987. }
  988. include '../../../../programs/develop/libraries/TinyGL/asm_fork/export.inc'
  989.         dd 0,0
  990. macro E_LIB n
  991. {
  992.         sz_#n db `n,0
  993. }
  994. include '../../../../programs/develop/libraries/TinyGL/asm_fork/export.inc'
  995.  
  996. last_time dd 0
  997.  
  998. align 4
  999. buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  1000.         dw 530 ;+4 left
  1001.         dw 30 ;+6 top
  1002. .w: dd 256 ;+8 w
  1003. .h: dd 512 ;+12 h
  1004. .color: dd 0xffffd0 ;+16 color
  1005.         db 24 ;+20 bit in pixel
  1006.  
  1007. align 4
  1008. buf_1: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
  1009.         dw 0 ;+4 left
  1010.         dw 0 ;+6 top
  1011. .w: dd 512 ;+8 w
  1012. .h: dd 512 ;+12 h
  1013. .color: dd 0xffffff ;+16 color
  1014.         db 24 ;+20 bit in pixel
  1015.  
  1016. align 4
  1017. ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
  1018. ;sizeof.TinyGLContext = 28
  1019.  
  1020. scale dd 1.414213562
  1021. angle_x dd 0.0
  1022. angle_y dd 0.0
  1023. angle_z dd 0.0
  1024. delt_size dd 3.0
  1025. mouse_drag dd 0 ;०¨¬ ¯®¢®à®â  áæ¥­ë ®â ¯¥à¥¬¥é¥­¨¨ ªãàá®à  ¬ëè¨
  1026. mouse_x dd 0
  1027. mouse_y dd 0
  1028. angle_dxm dd 2.8444 ;~ 3d_wnd_w/180 - ¯à¨¡ ¢«¥­¨¥ 㣫®¢ ¯®¢®à®â  áæ¥­ë ¯à¨ ¢à é¥­¨¨ ¬ë襩
  1029. angle_dym dd 2.8444 ;~ 3d_wnd_h/180
  1030.  
  1031. opt_light dw 0 ;®¯æ¨ï ¤«ï ¢ª«î祭¨ï/¢ëª«î祭¨ï ᢥâ 
  1032. opt_cube_box dw 1 ;®¯æ¨ï ¤«ï à¨á®¢ ­¨ï à ¬ª¨ ¢®ªà㣠®¡ê¥ªâ 
  1033. opt_auto_rotate dw 0 ;®¯æ¨ï ¤«ï  ¢â®¬ â¨ç¥áª®£® ¯®¢®à®â  ®¡ê¥ªâ 
  1034.  
  1035. light_position dd 0.0, 0.0, 2.0, 1.0 ;  á¯®«®¦¥­¨¥ ¨áâ®ç­¨ª  [0][1][2]
  1036.         ;[3] = (0.0 - ¡¥áª®­¥ç­® 㤠«¥­­ë© ¨áâ®ç­¨ª, 1.0 - ¨áâ®ç­¨ª á¢¥â  ­  ®¯à¥¤¥«¥­­®¬ à ááâ®ï­¨¨)
  1037. light_dir dd 0.0,0.0,0.0 ;­ ¯à ¢«¥­¨¥ « ¬¯ë
  1038.  
  1039. mat_specular dd 0.3, 0.3, 0.3, 1.0 ; –¢¥â ¡«¨ª 
  1040. mat_shininess dd 3.0 ;  §¬¥à ¡«¨ª  (®¡à â­ ï ¯à®¯®àæ¨ï)
  1041. white_light dd 0.8, 0.8, 0.8, 1.0 ; –¢¥â ¨ ¨­â¥­á¨¢­®áâì ®á¢¥é¥­¨ï, £¥­¥à¨à㥬®£® ¨áâ®ç­¨ª®¬
  1042. lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ;  à ¬¥âàë ä®­®¢®£® ®á¢¥é¥­¨ï
  1043.  
  1044.  
  1045. align 16
  1046. i_end:
  1047.         rb 4096
  1048. stacktop:
  1049.         sys_path rb 1024
  1050.         file_name rb 2048
  1051.         library_path rb 1024
  1052.         plugin_path rb 4096
  1053.         openfile_path rb 4096
  1054.         filename_area rb 256
  1055.         sc system_colors
  1056.         procinfo process_information
  1057.         run_file_70 FileInfoBlock
  1058. mem:
  1059.