2 * general header file for ypp-commodities
5 * This is part of ypp-sc-tools, a set of third-party tools for assisting
6 * players of Yohoho Puzzle Pirates.
8 * Copyright (C) 2009 Ian Jackson <ijackson@chiark.greenend.org.uk>
10 * This program is free software: you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation, either version 3 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 * Yohoho and Puzzle Pirates are probably trademarks of Three Rings and
24 * are used without permission. This program is not endorsed or
25 * sponsored by Three Rings.
41 /*----- from rgbimage.c -----*/
43 #define MAXIMGIDENT 100
45 typedef struct RgbImage {
48 /* red = data[ y*w*3 + x*3 + 0 ] = RI_PIXEL(ri,x,y)[0]
49 * green = data[ y*w*3 + x*3 + 1 ] = RI_PIXEL(ri,x,y)[1]
50 * blue = data[ y*w*3 + x*3 + 2 ] = RI_PIXEL(ri,x,y)[2]
54 void identify_rgbimage(const RgbImage *base, Rect portion,
55 char result[MAXIMGIDENT], const char *what);
56 RgbImage *alloc_rgb_image(int w, int h);
58 #define RI_PIXEL(ri,x,y) ((ri)->data + ((y)*(ri)->w + (x)) * 3)
60 /*----- from structure.c -----*/
62 void find_structure(const CanonImage *im, int *max_relevant_y_r);
64 void find_islandname(void);
65 void check_correct_commodities(void);
66 void read_screenshots(void);
67 void read_one_screenshot(void);
68 void analyse(FILE *tsv_output);
70 /*----- from convert.c -----*/
72 extern FILE *screenshot_file;
74 void vwarning(const char *fmt, va_list) FMT(1,0);
75 void warning(const char *fmt, ...) FMT(1,2);
77 void vprogress(const char *fmt, va_list) FMT(1,0);
78 void progress(const char *fmt, ...) FMT(1,2);
80 void vprogress_log(const char *fmt, va_list) FMT(1,0);
81 void progress_log(const char *fmt, ...) FMT(1,2);
83 void vprogress_spinner(const char *fmt, va_list) FMT(1,0);
84 void progress_spinner(const char *fmt, ...) FMT(1,2);
86 /*----- from pages.c -----*/
88 void screenshot_startup(void);
89 void set_yppclient_window(unsigned long wul);
90 void find_yppclient_window(void);
91 void take_screenshots(void);
92 void take_one_screenshot(void);
95 extern CanonImage *page_images[MAX_PAGES];
97 RgbImage *page0_rgbimage;
99 extern char *ocean, *pirate;