Added Infantry HD textures.

This commit is contained in:
Justin Marshall
2020-06-21 19:46:11 -07:00
parent c4f6f664c1
commit 6834288c16
3 changed files with 50 additions and 2 deletions
+42
View File
@@ -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.
+7 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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