Skip to content

Commit

Permalink
Minor code style fix in PlacementPreview hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Belonit committed Jan 14, 2024
1 parent 5243923 commit 8250ad1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/Ext/BuildingType/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,9 @@ DEFINE_HOOK(0x6D528A, TacticalClass_DrawPlacement_PlacementPreview, 0x6)
BlitterFlags blitFlags = pTypeExt->PlacementPreview_Translucency.Get(pRules->PlacementPreview_Translucency) |
BlitterFlags::Centered | BlitterFlags::Nonzero | BlitterFlags::MultiPass;

ConvertClass* pPalette = nullptr;
{
if (pTypeExt->PlacementPreview_Remap.Get())
pPalette = pBuilding->GetDrawer();
else
pPalette = pTypeExt->PlacementPreview_Palette.GetOrDefaultConvert(FileSystem::UNITx_PAL());
}
ConvertClass* pPalette = pTypeExt->PlacementPreview_Remap.Get()
? pBuilding->GetDrawer()
: pTypeExt->PlacementPreview_Palette.GetOrDefaultConvert(FileSystem::UNITx_PAL());

DSurface* pSurface = DSurface::Temp;
RectangleStruct nRect = pSurface->GetRect();
Expand All @@ -141,7 +137,7 @@ DEFINE_HOOK(0x6D528A, TacticalClass_DrawPlacement_PlacementPreview, 0x6)
return 0;
}

DEFINE_HOOK(0x47EFAE, CellClass_Draw_It_MakePlacementGridTranparent, 0x6)
DEFINE_HOOK(0x47EFAE, CellClass_Draw_It_SetPlacementGridTranslucency, 0x6)
{
LEA_STACK(BlitterFlags*, blitFlags, STACK_OFFSET(0x68, -0x58));

Expand Down

0 comments on commit 8250ad1

Please sign in to comment.