Subversion Repositories Kolibri OS

Rev

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