Skip to content

Commit

Permalink
Remove unnecessary state
Browse files Browse the repository at this point in the history
  • Loading branch information
ZivDero committed Sep 11, 2024
1 parent ab8f48a commit bc1dd9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
20 changes: 9 additions & 11 deletions src/extensions/tiberium/tiberiumext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ HRESULT TiberiumClassExtension::Load(IStream *pStm)
}

new (this) TiberiumClassExtension(NoInitClass());

VINIFERA_SWIZZLE_REQUEST_POINTER_REMAP(Overlay, "Overlay");

return hr;
}
Expand Down Expand Up @@ -196,11 +194,6 @@ bool TiberiumClassExtension::Read_INI(CCINIClass &ini)
{
//EXT_DEBUG_TRACE("TiberiumClassExtension::Read_INI - Name: %s (0x%08X)\n", Name(), (uintptr_t)(This()));

// Default values set from the TiberiumType
Overlay = This()->Image;
UseSlopes = This()->NumSlopeFacings > 0;
DamageToInfantry = This()->Power / 10;

if (!AbstractTypeClassExtension::Read_INI(ini)) {
return false;
}
Expand All @@ -214,13 +207,18 @@ bool TiberiumClassExtension::Read_INI(CCINIClass &ini)
PipIndex = ini.Get_Int(ini_name, "PipIndex", PipIndex);
PipDrawOrder = ini.Get_Int(ini_name, "PipDrawOrder", PipDrawOrder);

Overlay = (OverlayTypeClass*)ini.Get_Overlay(ini_name, "Overlay", Overlay);
UseSlopes = ini.Get_Bool(ini_name, "UseSlopes", UseSlopes);
// Default values set from the TiberiumType
OverlayTypeClass* overlay = This()->Image;
bool useSlopes = This()->NumSlopeFacings > 0;
DamageToInfantry = This()->Power / 10;

overlay = (OverlayTypeClass*)ini.Get_Overlay(ini_name, "Overlay", overlay);
useSlopes = ini.Get_Bool(ini_name, "UseSlopes", useSlopes);

This()->Image = Overlay;
This()->Image = overlay;
This()->NumFrames = 12;
This()->NumImages = 12;
This()->NumSlopeFacings = UseSlopes ? 8 : 0;
This()->NumSlopeFacings = useSlopes ? 8 : 0;

DamageToInfantry = ini.Get_Int(ini_name, "DamageToInfantry", DamageToInfantry);

Expand Down
10 changes: 0 additions & 10 deletions src/extensions/tiberium/tiberiumext.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,6 @@ TiberiumClassExtension final : public AbstractTypeClassExtension
*/
int PipDrawOrder;

/**
* Custom OverlayType that is the start of this Tiberium's overlays.
*/
OverlayTypeClass* Overlay;

/**
* Should this Tiberium type use slopes?
*/
bool UseSlopes;

/**
* The damage this Tiberium does to infantry.
*/
Expand Down

0 comments on commit bc1dd9e

Please sign in to comment.