Rev 6043 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6043 | Rev 6053 | ||
---|---|---|---|
Line 40... | Line 40... | ||
40 | } |
40 | } |
Line 41... | Line 41... | ||
41 | 41 | ||
42 | 42 | ||
43 | enum { |
43 | enum { |
44 | STEP_1_DOWNLOAD_PAGE = 0, |
44 | STEP_1_DOWNLOAD_PAGE = 0, |
45 | STEP_2_COUNT_PAGE_HEIGHT = 30, |
45 | STEP_2_COUNT_PAGE_HEIGHT = 35, |
46 | STEP_3_DRAW_PAGE_INTO_BUFFER = 60, |
46 | STEP_3_DRAW_PAGE_INTO_BUFFER = 60, |
47 | STEP_4_SMOOTH_FONT = 94, |
47 | STEP_4_SMOOTH_FONT = 88, |
Line 48... | Line 48... | ||
48 | STEP_5_STOP = 100, |
48 | STEP_5_STOP = 100, |
49 | }; |
49 | }; |
50 | 50 | ||
51 | void DrawProgress(int percent) |
51 | void DrawProgress(int percent) |
52 | { |
52 | { |
53 | int progress_width; |
53 | int progress_width; |
54 | if (percent<100) { |
- | |
55 | progress_width = address_box.width+5*percent/100; |
54 | if (percent<100) { |
56 | DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0x72B7EA); |
55 | progress_width = address_box.width+5*percent/100; |
57 | //debugi(percent); |
56 | DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0x72B7EA); |
58 | } |
57 | } |
59 | else { |
58 | else { |
60 | progress_width = address_box.width+5; |
59 | progress_width = address_box.width+5; |
61 | DrawBar(address_box.left-3, address_box.top+16, progress_width, 2, 0xFFFfff); |
- | |
62 | } |
- | |
63 | } |
- | |
64 | - | ||
65 | int progress_percent; |
- | |
66 | void DrawProgressWhileDrawing(dword bufoff, buflen) |
- | |
67 | { |
- | |
68 | int progress_cur = bufoff - io.buffer_data; |
- | |
69 | int progress_max = buflen - io.buffer_data; |
- | |
70 | int new_progress_percent = STEP_4_SMOOTH_FONT-STEP_3_DRAW_PAGE_INTO_BUFFER*progress_cur/progress_max + STEP_3_DRAW_PAGE_INTO_BUFFER; |
- | |
71 | if (progress_percent != new_progress_percent) { |
- | |
72 | progress_percent = new_progress_percent; |
- |