Merge remote-tracking branch 'upstream/master' into nev6502_branch

This commit is contained in:
nev6502
2020-06-21 20:59:03 -06:00
6 changed files with 125 additions and 25 deletions
+3
View File
@@ -1,5 +1,8 @@
# CnC_Remastered_Collection
Join us on our discord!
https://discord.gg/UfDzG9C
How to use:
You can use the vanilla assets, but this codebase supports the remaster assets as well. Please support EA and purchase the remaster!
+42
View File
@@ -48,6 +48,7 @@
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#include "function.h"
#include "Image.h"
void const * AircraftTypeClass::LRotorData = NULL;
@@ -426,6 +427,47 @@ void AircraftTypeClass::One_Time(void)
*/
_makepath(fullname, NULL, NULL, uclass.Graphic_Name(), ".SHP");
((void const *&)uclass.ImageData) = MFCD::Retrieve(fullname);
{
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;
}
}
}
LRotorData = MFCD::Retrieve("LROTOR.SHP");
+30 -23
View File
@@ -409,6 +409,7 @@ void AircraftClass::Draw_It(int x, int y, WindowNumberType window) const
** Verify the legality of the unit class.
*/
void const * shapefile = Get_Image_Data();
Image_t* hdShapeFile = Get_HDImage_Data();
if (!shapefile) return;
int shapenum = Shape_Number();
@@ -440,33 +441,39 @@ void AircraftClass::Draw_It(int x, int y, WindowNumberType window) const
static int _jitter[] = {0,0,0,0,1,1,1,0,0,0,0,0,-1,-1,-1,0};
jitter = _jitter[::Frame % 16];
}
// Virtual window needs to draw the body first so it's considered the primary object and the shadow is a sub-object
if (window == WINDOW_VIRTUAL) {
/*
** Draw the root body of the unit.
*/
Techno_Draw_Object(shapefile, shapenum, x, y+jitter, window, rotation);
/*
** Special manual shadow draw code.
*/
if (Visual_Character() <= VISUAL_DARKEN) {
CC_Draw_Shape(this, shapefile, shapenum, x+1, y+2, window, SHAPE_PREDATOR|SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_FADING, DisplayClass::FadingShade, NULL);
}
} else {
/*
** Special manual shadow draw code.
*/
if (Visual_Character() <= VISUAL_DARKEN) {
CC_Draw_Shape(this, shapefile, shapenum, x+1, y+2, window, SHAPE_PREDATOR|SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_FADING, DisplayClass::FadingShade, NULL);
}
// jmarshall
// // Virtual window needs to draw the body first so it's considered the primary object and the shadow is a sub-object
// if (window == WINDOW_VIRTUAL) {
// /*
// ** Draw the root body of the unit.
// */
// Techno_Draw_Object(shapefile, shapenum, x, y+jitter, window, rotation);
//
// /*
// ** Special manual shadow draw code.
// */
// if (Visual_Character() <= VISUAL_DARKEN) {
// CC_Draw_Shape(this, shapefile, shapenum, x+1, y+2, window, SHAPE_PREDATOR|SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_FADING, DisplayClass::FadingShade, NULL);
// }
// } else {
// /*
// ** Special manual shadow draw code.
// */
// if (Visual_Character() <= VISUAL_DARKEN) {
// CC_Draw_Shape(this, shapefile, shapenum, x+1, y+2, window, SHAPE_PREDATOR|SHAPE_CENTER|SHAPE_WIN_REL|SHAPE_FADING, DisplayClass::FadingShade, NULL);
// }
/*
** Draw the root body of the unit.
*/
Techno_Draw_Object(shapefile, shapenum, x, y+jitter, window, rotation);
}
if (hdShapeFile) {
Techno_Draw_Object_HD(hdShapeFile, shapenum, x, y + jitter, window, rotation);
}
else {
Techno_Draw_Object(shapefile, shapenum, x, y + jitter, window, rotation);
}
// }
// jmarshall end
/*
** If this aircraft is equipped with rotor blades, then draw them at this time.
+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