From c4f6f664c1ff26690b60b5f93bfc52ddd69d63ff Mon Sep 17 00:00:00 2001 From: jmarshall23 <38022578+jmarshall23@users.noreply.github.com> Date: Sun, 21 Jun 2020 17:31:20 -0700 Subject: [PATCH 1/3] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9c07fa3..e17db8b 100644 --- a/README.md +++ b/README.md @@ -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! From 6834288c16a7c8ac05b63fd621d8b4122c5494f3 Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Sun, 21 Jun 2020 19:46:11 -0700 Subject: [PATCH 2/3] Added Infantry HD textures. --- code/REDALERT/IDATA.CPP | 42 ++++++++++++++++++++++++++++++++++++++ code/REDALERT/INFANTRY.CPP | 8 +++++++- code/REDALERT/Image.h | 2 +- 3 files changed, 50 insertions(+), 2 deletions(-) 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 From 332c36efa329b3a4c13cbf885f20ddf55155ef2e Mon Sep 17 00:00:00 2001 From: Justin Marshall Date: Sun, 21 Jun 2020 19:53:01 -0700 Subject: [PATCH 3/3] Aircraft remaster assets now load. --- code/REDALERT/AADATA.CPP | 42 ++++++++++++++++++++++++++++++ code/REDALERT/AIRCRAFT.CPP | 53 +++++++++++++++++++++----------------- 2 files changed, 72 insertions(+), 23 deletions(-) diff --git a/code/REDALERT/AADATA.CPP b/code/REDALERT/AADATA.CPP index 473826d..b5f0d4b 100644 --- a/code/REDALERT/AADATA.CPP +++ b/code/REDALERT/AADATA.CPP @@ -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"); diff --git a/code/REDALERT/AIRCRAFT.CPP b/code/REDALERT/AIRCRAFT.CPP index 7722529..5e40fae 100644 --- a/code/REDALERT/AIRCRAFT.CPP +++ b/code/REDALERT/AIRCRAFT.CPP @@ -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.