Fix for placement editor crash.

This commit is contained in:
Justin Marshall
2020-06-20 14:47:37 -07:00
parent 5d8b853436
commit acc1af0c05
+17 -14
View File
@@ -3198,20 +3198,23 @@ void TemplateTypeClass::Display(int x, int y, WindowNumberType window, HousesTyp
for (index = 0; index < w*h; index++) {
if (map[index] != 0xFF) {
HidPage.Draw_Stamp(iconset, index, 0, 0, NULL, WINDOW_MAIN);
Buffer_Enable_HD_Texture(true); // At this point, Draw_Stamp creates a 32bit image.
if (scale) {
HidPage.Scale((*LogicPage), 0, 0,
x + ((index % w)*(ICON_PIXEL_W/2)),
y + ((index / w)*(ICON_PIXEL_H/2)),
ICON_PIXEL_W, ICON_PIXEL_H,
ICON_PIXEL_W/2, ICON_PIXEL_H/2, (char *)NULL);
} else {
HidPage.Blit((*LogicPage), 0, 0, x + ((index % w)*(ICON_PIXEL_W)),
y + ((index / w)*(ICON_PIXEL_H)), ICON_PIXEL_W, ICON_PIXEL_H);
}
Buffer_Enable_HD_Texture(false);
// jmarshall - even if using legacy data, always use hdimage.
HidPage.Draw_Stamp(Get_HDImage_Data(), index, 0, 0, NULL, WINDOW_MAIN);
// Disabled legacy blit code.
//Buffer_Enable_HD_Texture(true); // At this point, Draw_Stamp creates a 32bit image.
//if (scale) {
// HidPage.Scale((*LogicPage), 0, 0,
// x + ((index % w)*(ICON_PIXEL_W/2)),
// y + ((index / w)*(ICON_PIXEL_H/2)),
// ICON_PIXEL_W, ICON_PIXEL_H,
// ICON_PIXEL_W/2, ICON_PIXEL_H/2, (char *)NULL);
//
//} else {
// HidPage.Blit((*LogicPage), 0, 0, x + ((index % w)*(ICON_PIXEL_W)),
// y + ((index / w)*(ICON_PIXEL_H)), ICON_PIXEL_W, ICON_PIXEL_H);
//}
//Buffer_Enable_HD_Texture(false);
// jmarshall end
}
}
}