fix broken map generation

pull/35/head
Sean Barrett 2014-08-17 21:08:43 -07:00
parent 45469cfa27
commit 14e8b66119
2 changed files with 11 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* stbhw - v0.5 - http://nothings.org/gamedev/herringbone
/* stbhw - v0.6 - http://nothings.org/gamedev/herringbone
Herringbone Wang Tile Generator - Sean Barrett 2014 - public domain
This file is in the public domain. In case that declaration is ineffective,
@ -135,6 +135,11 @@ int main(int argc, char **argv)
return 0;
}
== VERSION HISTORY ===================
0.6 2014-08-17 - fix broken map-maker
0.5 2014-07-07 - initial release
*/
//////////////////////////////////////////////////////////////////////////////
@ -484,9 +489,6 @@ static int stbhw__process_template(stbhw__process *p)
return 0;
}
for (j=0; j < p->h; ++j)
memset(p->data + j*p->stride, 255, 3*p->w);
if (c->is_corner) {
ypos = 2;
for (k=0; k < c->num_color[2]; ++k) {
@ -1184,6 +1186,9 @@ STBHW_EXTERN int stbhw_make_template(stbhw_config *c, unsigned char *data, int w
p.process_v_rect = stbhw__edge_process_v_rect;
}
for (i=0; i < p.h; ++i)
memset(p.data + i*p.stride, 255, 3*p.w);
if (!stbhw__process_template(&p))
return 0;

View File

@ -29,7 +29,8 @@ int main(int argc, char **argv)
pixels = stbi_load(filename, &w, &h, 0, 3);
if (pixels == 0) {
fprintf(stderr, "Could open input file '%s'\n", filename);
fprintf(stderr, "Couldn't open input file '%s'\n", filename);
exit(1);
}
if (!stbhw_build_tileset_from_image(&ts, pixels, w*3, w, h)) {