mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Added support for separate active animation SHP.
This commit is contained in:
@@ -2947,6 +2947,7 @@ BuildingTypeClass::BuildingTypeClass(
|
|||||||
|
|
||||||
memset(CustomTheatrePalette, 0, sizeof(CustomTheatrePalette));
|
memset(CustomTheatrePalette, 0, sizeof(CustomTheatrePalette));
|
||||||
IdleAnimShape = NULL;
|
IdleAnimShape = NULL;
|
||||||
|
ActiveAnimAnimShape = NULL;
|
||||||
|
|
||||||
Anims[BSTATE_CONSTRUCTION].Start = 0;
|
Anims[BSTATE_CONSTRUCTION].Start = 0;
|
||||||
Anims[BSTATE_CONSTRUCTION].Count = 1;
|
Anims[BSTATE_CONSTRUCTION].Count = 1;
|
||||||
@@ -4005,6 +4006,7 @@ bool BuildingTypeClass::Read_INI(CCINIClass & ini)
|
|||||||
{
|
{
|
||||||
char customPalName[512];
|
char customPalName[512];
|
||||||
char idleAnimName[512];
|
char idleAnimName[512];
|
||||||
|
char ConstructAnimName[512];
|
||||||
|
|
||||||
if (TechnoTypeClass::Read_INI(ini)) {
|
if (TechnoTypeClass::Read_INI(ini)) {
|
||||||
Speed = ini.Get_Bool(Name(), "WaterBound", (Speed == SPEED_FLOAT)) ? SPEED_FLOAT : SPEED_NONE;
|
Speed = ini.Get_Bool(Name(), "WaterBound", (Speed == SPEED_FLOAT)) ? SPEED_FLOAT : SPEED_NONE;
|
||||||
@@ -4028,6 +4030,10 @@ bool BuildingTypeClass::Read_INI(CCINIClass & ini)
|
|||||||
IdleAnimShape = MFCD::Retrieve(idleAnimName);
|
IdleAnimShape = MFCD::Retrieve(idleAnimName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ini.Get_String(Name(), "ActiveAnim", "", &ConstructAnimName[0], sizeof(ConstructAnimName)) > 0) {
|
||||||
|
ActiveAnimAnimShape = MFCD::Retrieve(ConstructAnimName);
|
||||||
|
}
|
||||||
|
|
||||||
if (Power < 0) {
|
if (Power < 0) {
|
||||||
Drain = -Power;
|
Drain = -Power;
|
||||||
Power = 0;
|
Power = 0;
|
||||||
|
|||||||
@@ -474,21 +474,36 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
|||||||
CCGlobalOveridePalette = (void *)Class->CustomTheatrePalette[LastTheater];
|
CCGlobalOveridePalette = (void *)Class->CustomTheatrePalette[LastTheater];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
int animShapeNum = Shape_Number();
|
||||||
|
|
||||||
|
// If we have a seperate activation animation, play that instead of cycling through the frames here.
|
||||||
|
if (BState == BSTATE_ACTIVE && Class->ActiveAnimAnimShape != NULL) {
|
||||||
|
animShapeNum = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (hdimage != NULL) {
|
if (hdimage != NULL) {
|
||||||
Techno_Draw_Object_HD(hdimage, Shape_Number(), x, y, window);
|
Techno_Draw_Object_HD(hdimage, animShapeNum, x, y, window);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Techno_Draw_Object(shapefile, Shape_Number(), x, y, window);
|
Techno_Draw_Object(shapefile, animShapeNum, x, y, window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// jmarshall end
|
// jmarshall end
|
||||||
|
|
||||||
// jmarshall idle animation
|
// jmarshall idle/construction animation
|
||||||
if (Class->IdleAnimShape != NULL) {
|
if (Class->IdleAnimShape != NULL) {
|
||||||
int shapeNum = animFrameNum;
|
int shapeNum = animFrameNum;
|
||||||
shapeNum = shapeNum % Get_Build_Frame_Count(Class->IdleAnimShape);
|
shapeNum = shapeNum % Get_Build_Frame_Count(Class->IdleAnimShape);
|
||||||
Techno_Draw_Object(Class->IdleAnimShape, shapeNum, x, y, window);
|
Techno_Draw_Object(Class->IdleAnimShape, shapeNum, x, y, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (BState == BSTATE_ACTIVE && Class->ActiveAnimAnimShape != NULL) {
|
||||||
|
int shapeNum = Shape_Number();
|
||||||
|
shapeNum = shapeNum % Get_Build_Frame_Count(Class->ActiveAnimAnimShape);
|
||||||
|
Techno_Draw_Object(Class->ActiveAnimAnimShape, shapeNum, x, y, window);
|
||||||
|
}
|
||||||
|
|
||||||
CCGlobalOveridePalette = NULL;
|
CCGlobalOveridePalette = NULL;
|
||||||
// jmarshall end
|
// jmarshall end
|
||||||
|
|
||||||
|
|||||||
@@ -820,6 +820,7 @@ class BuildingTypeClass : public TechnoTypeClass {
|
|||||||
|
|
||||||
const void* CustomTheatrePalette[3];
|
const void* CustomTheatrePalette[3];
|
||||||
const void* IdleAnimShape;
|
const void* IdleAnimShape;
|
||||||
|
const void* ActiveAnimAnimShape;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user