diff --git a/code/redalert/bdata.cpp b/code/redalert/bdata.cpp index 37230b7..92dfd0a 100644 --- a/code/redalert/bdata.cpp +++ b/code/redalert/bdata.cpp @@ -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); diff --git a/code/redalert/building.cpp b/code/redalert/building.cpp index f90f66c..08790f0 100644 --- a/code/redalert/building.cpp +++ b/code/redalert/building.cpp @@ -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 diff --git a/code/redalert/type.h b/code/redalert/type.h index c299461..61bbb3f 100644 --- a/code/redalert/type.h +++ b/code/redalert/type.h @@ -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 diff --git a/rules.ini b/rules.ini index 9e6608a..7410a6c 100644 --- a/rules.ini +++ b/rules.ini @@ -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]