Rev 1632 | Rev 6328 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
255 | heavyiron | 1 | ; load picture from file to memory |
2 | |||
3 | load_picture: |
||
1643 | mario79 | 4 | mov eax,file_path |
5 | mov ebx,[ScreenPointer] |
||
6 | add ebx,0x10000 |
||
255 | heavyiron | 7 | |
1643 | mario79 | 8 | call load_heading_of_file |
255 | heavyiron | 9 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 16 | |
1643 | mario79 | 17 | cmp [type],word 'BM' |
18 | jne no_bmp_file_1 |
||
255 | heavyiron | 19 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 27 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 35 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 44 | |
1643 | mario79 | 45 | no_gif_file_1: |
46 | jmp no_unpakcing_file_1 |
||
255 | heavyiron | 47 | |
1643 | mario79 | 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 | ;---------------------------------------------------------- |
||
255 | heavyiron | 56 | |
1643 | mario79 | 57 | mov eax,file_path |
58 | mov ebx,[PointerToCopyPicture] |
||
59 | add ebx,1000 |
||
60 | call load_file |
||
255 | heavyiron | 61 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 75 | |
1643 | mario79 | 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 |
||
255 | heavyiron | 83 | |
1643 | mario79 | 84 | no_unpakcing_file_1: |
85 | call MovePictureToWorkScreen |
||
86 | mov [Scroll1CoordinatX],9 |
||
87 | mov [Scroll2CoordinatY],89 |
||
88 | ret |