+ else if (w->winmapsize.x > new_size_x)
+ {
+ new_size_x = w->winmapsize.x;
+ }
+ chtype * old_winmap = w->winmap;
+ uint32_t new_size = sizeof(chtype) * new_size_y * new_size_x;
+ w->winmap = try_malloc(new_size, world, f_name);
+ uint16_t y, x;
+ for (y = 0; y < new_size_y; y++)
+ {
+ for (x = 0; y < w->winmapsize.y && x < w->winmapsize.x; x++)
+ {
+ chtype ch = old_winmap[(y * w->winmapsize.x) + x];
+ w->winmap[(y * new_size_x) + x] = ch;
+ }
+ for (; x < new_size_x; x++)
+ {
+ w->winmap[(y * new_size_x) + x] = ' ';
+ }
+ }
+ free(old_winmap);
+ w->winmapsize.y = new_size_y;
+ w->winmapsize.x = new_size_x;