mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-11 23:50:51 +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));
|
||||
IdleAnimShape = NULL;
|
||||
ActiveAnimAnimShape = NULL;
|
||||
|
||||
Anims[BSTATE_CONSTRUCTION].Start = 0;
|
||||
Anims[BSTATE_CONSTRUCTION].Count = 1;
|
||||
@@ -4005,6 +4006,7 @@ bool BuildingTypeClass::Read_INI(CCINIClass & ini)
|
||||
{
|
||||
char customPalName[512];
|
||||
char idleAnimName[512];
|
||||
char ConstructAnimName[512];
|
||||
|
||||
if (TechnoTypeClass::Read_INI(ini)) {
|
||||
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);
|
||||
}
|
||||
|
||||
if (ini.Get_String(Name(), "ActiveAnim", "", &ConstructAnimName[0], sizeof(ConstructAnimName)) > 0) {
|
||||
ActiveAnimAnimShape = MFCD::Retrieve(ConstructAnimName);
|
||||
}
|
||||
|
||||
if (Power < 0) {
|
||||
Drain = -Power;
|
||||
Power = 0;
|
||||
|
||||
@@ -474,21 +474,36 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
CCGlobalOveridePalette = (void *)Class->CustomTheatrePalette[LastTheater];
|
||||
}
|
||||
|
||||
if (hdimage != NULL) {
|
||||
Techno_Draw_Object_HD(hdimage, Shape_Number(), x, y, window);
|
||||
}
|
||||
else {
|
||||
Techno_Draw_Object(shapefile, Shape_Number(), x, y, window);
|
||||
{
|
||||
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) {
|
||||
Techno_Draw_Object_HD(hdimage, animShapeNum, x, y, window);
|
||||
}
|
||||
else {
|
||||
Techno_Draw_Object(shapefile, animShapeNum, x, y, window);
|
||||
}
|
||||
}
|
||||
// jmarshall end
|
||||
|
||||
// jmarshall idle animation
|
||||
// jmarshall idle/construction animation
|
||||
if (Class->IdleAnimShape != NULL) {
|
||||
int shapeNum = animFrameNum;
|
||||
shapeNum = shapeNum % Get_Build_Frame_Count(Class->IdleAnimShape);
|
||||
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;
|
||||
// jmarshall end
|
||||
|
||||
|
||||
@@ -820,6 +820,7 @@ class BuildingTypeClass : public TechnoTypeClass {
|
||||
|
||||
const void* CustomTheatrePalette[3];
|
||||
const void* IdleAnimShape;
|
||||
const void* ActiveAnimAnimShape;
|
||||
private:
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user