void take_screenshots(void) {
Snapshot *current=0, *last=0;
+ RgbImage *page0_store;
prepare_ypp_client();
wait_for_stability(¤t,0, send_pgup_many,
"paging up to top of commodity list...");
+ page0_rgbimage= page0_store= alloc_rgb_image(current->w, current->h);
+
/* now to actually page down */
for (;;) {
debugf("paging page %d\n",npages);
fatal("Paging down seems to generate too many pages - max is %d.",
MAX_PAGES);
- page_images[npages]= convert_page(current, 0);
- free_snapshot(&last); last=current; current=0;
+ page_images[npages]= convert_page(current, page0_store);
+ free_snapshot(&last); last=current; current=0; page0_store=0;
debugf("PAGING page %d converted\n",npages);
debugf("PAGING all done.\n");
progress_log("collected %d screenshots.",npages);
+ assert(!page0_store);
}
void take_one_screenshot(void) {
static const char prefix[]= "Puzzle Pirates - ";
static const char onthe[]= " on the ";
static const char suffix[]= " ocean";
-#define S(x) (sizeof((x))-1)
+#define S(x) ((int)sizeof((x))-1)
debugfind("FINDYPP %d/%d screen %d %*s %lx",
depth,targetdepth,screen,
REQUIRE( !memcmp(spc1, onthe, S(onthe)) );
#define ASSIGN(what, start, end) \
- what= masprintf("%.*s", (end)-(start), start); \
+ what= masprintf("%.*s", (int)((end)-(start)), start); \
if (o_##what) REQUIRE( !strcasecmp(o_##what, what) ); \
else