diff --git a/code/REDALERT/IDATA.CPP b/code/REDALERT/IDATA.CPP index 2efc287..a7b6f49 100644 --- a/code/REDALERT/IDATA.CPP +++ b/code/REDALERT/IDATA.CPP @@ -49,6 +49,7 @@ #include "function.h" #include "type.h" +#include "image.h" static DoInfoStruct DogDoControls[DO_COUNT] = { {0, 1, 1}, // DO_STAND_READY @@ -1420,6 +1421,47 @@ void InfantryTypeClass::One_Time(void) #else ((void const *&)uclass->ImageData) = MFCD::Retrieve(fullname); #endif + { + const char* imageFileName = Units_FindHDTexture(fullname, 0, 0); + + if (imageFileName) { + Image_t* image = Image_LoadImage(imageFileName, true, true); + int numUnitsAnims = Units_GetNumFramesForTile(fullname, 0); + int shapeId = 1; + + // Load the old school animation pipeline. + { + while (true) { + imageFileName = Units_FindHDTexture(fullname, shapeId, 0); + if (imageFileName == NULL) + break; + + for (int d = 0; d < MAX_MPLAYER_COLORS; d++) { + Image_Add32BitImage(imageFileName, image, d, shapeId, 0); + } + shapeId++; + } + } + + for (int d = 0; d < shapeId; d++) { + image->renderwidth[d] = image->renderwidth[d] / 5; + image->renderheight[d] = image->renderheight[d] / 5; + } + + if (numUnitsAnims > 0) + { + for (int i = 1; i < numUnitsAnims; i++) { + imageFileName = Units_FindHDTexture(fullname, 0, i); + for (int d = 0; d < MAX_MPLAYER_COLORS; d++) { + Image_Add32BitImage(imageFileName, image, d, 0, i); + } + } + } + + image->numFrames = numUnitsAnims; + ((void const*&)uclass->HDImageData) = image; + } + } /* ** The small build image icon sized shapes are always generic. diff --git a/code/REDALERT/INFANTRY.CPP b/code/REDALERT/INFANTRY.CPP index edcbf75..afa8b8a 100644 --- a/code/REDALERT/INFANTRY.CPP +++ b/code/REDALERT/INFANTRY.CPP @@ -569,6 +569,7 @@ void InfantryClass::Draw_It(int x, int y, WindowNumberType window) const ** there is no shape image, then it certainly can't be drawn -- bail. */ void const * shapefile = Get_Image_Data(); + Image_t* hdShapeFIle = Get_HDImage_Data(); if (shapefile == NULL) return; @@ -578,7 +579,12 @@ void InfantryClass::Draw_It(int x, int y, WindowNumberType window) const /* ** Actually draw the root body of the unit. */ - Techno_Draw_Object(shapefile, Shape_Number(window), x, y, window); + if (hdShapeFIle) { + Techno_Draw_Object_HD(hdShapeFIle, Shape_Number(window), x, y, window); + } + else { + Techno_Draw_Object(shapefile, Shape_Number(window), x, y, window); + } FootClass::Draw_It(x, y, window); } diff --git a/code/REDALERT/Image.h b/code/REDALERT/Image.h index d12f2d8..0c5e78b 100644 --- a/code/REDALERT/Image.h +++ b/code/REDALERT/Image.h @@ -1,7 +1,7 @@ // Image.h // -#define MAX_IMAGE_SHAPES 256 +#define MAX_IMAGE_SHAPES 1024 #define MAX_IMAGE_FRAMES 12 #define MAX_HOUSE_COLORS 8