Subversion Repositories Kolibri OS

Rev

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

  1. ; load picture from file to memory
  2.  
  3. load_picture:
  4.         mov     eax,file_path
  5.         mov     ebx,[ScreenPointer]
  6.         add     ebx,0x10000
  7.  
  8.         call    load_heading_of_file
  9.  
  10.         mov     esi,[ScreenPointer]
  11.         add     esi,0x10000
  12. ;-------------is this BMP file ?----------------
  13.         xor     eax,eax
  14.         mov     ax,[esi]
  15.         mov     [type],ax
  16.  
  17.         cmp     [type],word 'BM'
  18.         jne     no_bmp_file_1
  19.  
  20.         xor     eax,eax
  21.         xor     ebx,ebx
  22.         mov     eax,[esi+18]
  23.         mov     ebx,[esi+22]
  24.         mov     [Picture_SizeX],eax
  25.         mov     [Picture_SizeY],ebx
  26.         jmp     exit_type_1
  27.  
  28. no_bmp_file_1:
  29. ;-------------is this GIF file ?----------------
  30.         xor     eax,eax
  31.         mov     ax,[esi]
  32.         mov     [type],ax
  33.         cmp     [type],'GI'
  34.         jne     no_gif_file_1
  35.  
  36.         add     esi,6
  37.         xor     eax,eax
  38.         xor     ebx,ebx
  39.         mov     ax,word[esi]
  40.         mov     bx,word[esi+2]
  41.         mov     [Picture_SizeX],eax
  42.         mov     [Picture_SizeY],ebx
  43.         jmp     exit_type_1
  44.  
  45. no_gif_file_1:
  46.         jmp     no_unpakcing_file_1
  47.  
  48. exit_type_1:
  49. ;----------------------------------------------------------
  50. ;Get momory for unpacking picture and for picture's bufers
  51. ;----------------------------------------------------------
  52.         call GetMemory
  53. ;----------------------------------------------------------
  54. ;--------------------Load file in memory-------------------
  55. ;----------------------------------------------------------
  56.  
  57.         mov     eax,file_path
  58.         mov     ebx,[PointerToCopyPicture]
  59.         add     ebx,1000
  60.         call    load_file
  61.  
  62. ;----------------------------------------------------------
  63. ;-------------------Unpacking picture----------------------
  64. ;----------------------------------------------------------
  65.         mov     esi,[PointerToCopyPicture]
  66.         add     esi,1000
  67.         mov     edi,[PointerToPicture]
  68.         mov     eax,[ScreenPointer]
  69.         cmp     [type],'BM'
  70.         jne     no_unpakcing_bmp_file_1
  71. ;BMP DECODER
  72.         call    bmptoimg
  73.         mov     [save_flag],1
  74.         jmp     no_unpakcing_file_1
  75.  
  76. no_unpakcing_bmp_file_1:
  77.         cmp     [type],'GI'
  78.         jne     no_unpakcing_file_1
  79. ;GIF DECODER
  80.         sub     edi,8
  81.         call    ReadGIF
  82.         mov     [save_flag],1
  83.  
  84. no_unpakcing_file_1:
  85.         call    MovePictureToWorkScreen
  86.         mov     [Scroll1CoordinatX],9
  87.         mov     [Scroll2CoordinatY],89
  88.         ret
  89.