mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-11 23:50:51 +02:00
Added render offset for the Construction yard, width/height for buildings is now based on width/height of the first frame of the image.
This commit is contained in:
+3
-24
@@ -3810,18 +3810,7 @@ short const * BuildingTypeClass::Overlap_List(void) const
|
||||
*=============================================================================================*/
|
||||
int BuildingTypeClass::Width(void) const
|
||||
{
|
||||
static int width[BSIZE_COUNT] = {
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
3,
|
||||
4,
|
||||
5
|
||||
};
|
||||
return(width[Size]);
|
||||
return (Get_Build_Frame_Width(Get_Image_Data(), 0) / ICON_PIXEL_W) + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -3841,18 +3830,7 @@ int BuildingTypeClass::Width(void) const
|
||||
*=============================================================================================*/
|
||||
int BuildingTypeClass::Height(bool bib) const
|
||||
{
|
||||
static int height[BSIZE_COUNT] = {
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
3,
|
||||
2,
|
||||
5
|
||||
};
|
||||
return(height[Size] + ((bib && IsBibbed) ? 1 : 0));
|
||||
return (Get_Build_Frame_Height(Get_Image_Data(), 0) / ICON_PIXEL_H) + 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -4077,6 +4055,7 @@ bool BuildingTypeClass::Read_INI(CCINIClass & ini)
|
||||
ActiveAnimAnimShape = MFCD::Retrieve(ConstructAnimName);
|
||||
}
|
||||
|
||||
RenderOffsetY = ini.Get_Int(Name(), "RenderOffsetY", 0);
|
||||
IdleAnimIgnorePowerState = ini.Get_Int(Name(), "IdleAnimIgnorePowerState", 0);
|
||||
IdleHasShadowFrames = ini.Get_Int(Name(), "IdleHasShadowFrames", 0);
|
||||
IdleAnimNonDamagedStart = ini.Get_Int(Name(), "IdleAnimNonDamagedStart", -1);
|
||||
|
||||
@@ -463,6 +463,8 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
*/
|
||||
void const * shapefile = Get_Image_Data();
|
||||
if (shapefile == NULL) return;
|
||||
|
||||
y = y + Class->RenderOffsetY;
|
||||
|
||||
/*
|
||||
** Actually draw the building shape.
|
||||
@@ -609,7 +611,7 @@ void BuildingClass::Draw_It(int x, int y, WindowNumberType window) const
|
||||
}
|
||||
}
|
||||
|
||||
TechnoClass::Draw_It(x, y, window);
|
||||
TechnoClass::Draw_It(x, y - Class->RenderOffsetY, window);
|
||||
|
||||
/*
|
||||
** If this is a factory that we're spying on, show what it's producing
|
||||
|
||||
@@ -832,11 +832,9 @@ class BuildingTypeClass : public TechnoTypeClass {
|
||||
int ActiveAnimNonDamagedStart;
|
||||
int ActiveAnimNonDamagedFrames;
|
||||
int ActiveAnimDamagedStart;
|
||||
int ActiveAnimDamagedFrames;
|
||||
int ActiveAnimDamagedFrames;
|
||||
int RenderOffsetY;
|
||||
private:
|
||||
int tileW;
|
||||
int tileH;
|
||||
|
||||
/*
|
||||
** This is a pointer to a list of offsets (from the upper left corner) that
|
||||
** are used to indicate the building's "footprint". This footprint is used
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
[General]
|
||||
|
||||
; dev options
|
||||
FastBuild=0
|
||||
FastBuild=1
|
||||
|
||||
; crates
|
||||
CrateMinimum=1 ; crates are normally one per human player but never below this number
|
||||
@@ -1456,6 +1456,7 @@ ActiveAnimNonDamagedStart=0
|
||||
ActiveAnimNonDamagedFrames=41
|
||||
ActiveAnimDamagedStart=0
|
||||
ActiveAnimDamagedFrames=41
|
||||
RenderOffsetY=-40
|
||||
|
||||
; Pirsm Tower
|
||||
[GGPRIS]
|
||||
|
||||
Reference in New Issue
Block a user