Subversion Repositories Kolibri OS

Rev

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

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