Rev 8320 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8017 | leency | 1 | |
8016 | leency | 2 | { |
4411 | leency | 3 | collection url; |
8016 | leency | 4 | collection_int xywh; |
5 | int getid; |
||
6 | |||
8320 | leency | 7 | |
8016 | leency | 8 | dword add_pos(); |
8320 | leency | 9 | bool set_size(); |
10 | |||
11 | |||
8016 | leency | 12 | bool next_url(); |
13 | |||
8320 | leency | 14 | |
15 | bool draw(); |
||
16 | }; |
||
4411 | leency | 17 | |
4486 | leency | 18 | |
8320 | leency | 19 | { |
20 | url.drop(); |
||
21 | xywh.drop(); |
||
22 | getid = 0; |
||
23 | } |
||
24 | |||
8017 | leency | 25 | |
8320 | leency | 26 | { |
4411 | leency | 27 | char full_path[URL_SIZE]; |
8016 | leency | 28 | strncpy(#full_path, _path, URL_SIZE); |
29 | get_absolute_url(#full_path, history.current()); |
||
8320 | leency | 30 | |
8016 | leency | 31 | |
32 | xywh.add(_x); |
||
33 | xywh.add(_y); |
||
34 | xywh.add(NULL); |
||
8320 | leency | 35 | xywh.add(NULL); |
36 | return #full_path; |
||
8330 | leency | 37 | } |
8016 | leency | 38 | |
39 | |||
8330 | leency | 40 | { |
8016 | leency | 41 | img_decode stdcall (_buf, _size, 0); |
8320 | leency | 42 | if (EAX) { |
43 | EDI = EAX; |
||
44 | xywh.set(_id*4+2, ESDWORD[EDI+4]); |
||
8330 | leency | 45 | xywh.set(_id*4+3, ESDWORD[EDI+8]); |
46 | free(EDI); |
||
47 | return true; |
||
48 | } |
||
8320 | leency | 49 | return false; |
8330 | leency | 50 | } |
4411 | leency | 51 | |
52 | |||
8330 | leency | 53 | dword _img::current_url() |
8016 | leency | 54 | { |
55 | return url.get(getid); |
||
56 | } |
||
57 | |||
58 | |||
8330 | leency | 59 | bool _img::next_url() |
8016 | leency | 60 | { |
61 | if (getid < url.count-1) { |
||
62 | getid++; |
||
63 | return 1; |
||
64 | } |
||
65 | return 0; |
||
66 | } |
||
67 | |||
68 | |||
8330 | leency | 69 | { |
8016 | leency | 70 | int i, img_y; |
8320 | leency | 71 | |
8016 | leency | 72 | |
73 | { |
||
74 | img_y = xywh.get(i*4 + 1); |
||
75 | |||
76 | |||
8330 | leency | 77 | && (cache.has(url.get(i))) draw(_x, _y, _w, _h, _start, i); |
78 | } |
||
8016 | leency | 79 | } |
80 | |||
81 | |||
8330 | leency | 82 | { |
8020 | leency | 83 | int img_x, img_y, img_w, img_h; |
8330 | leency | 84 | img_decode stdcall (cache.current_buf, cache.current_size, 0); |
8320 | leency | 85 | if (EAX) { |
86 | EDI = EAX; |
||
8330 | leency | 87 | |
8020 | leency | 88 | |
8330 | leency | 89 | img_y = xywh.get(i*4+1); |
90 | img_w = math.min(xywh.set(getid*4+2, ESDWORD[EDI+4]), _w - img_x); |
||
91 | img_h = math.min(xywh.set(getid*4+3, ESDWORD[EDI+8]), _h + _start - img_y); |
||
92 | |||
4411 | leency | 93 | |
94 | |||
8330 | leency | 95 | free(EDI); |
96 | } |
||
4411 | leency | 97 | }>> |
4491 | leency | 98 |