mirror of
https://github.com/nothings/stb
synced 2025-02-07 22:04:04 +03:00
fix broken map generation
This commit is contained in:
parent
45469cfa27
commit
14e8b66119
@ -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;
|
||||
|
||||
|
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user