mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Fix for placement editor crash.
This commit is contained in:
+17
-14
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user