Merge pull request #7627 from archimede67/fix-colorable-game-layers

Fix colorable entities layers
This commit is contained in:
Dennis Felsing 2023-12-11 12:58:39 +00:00 committed by GitHub
commit 5013962480
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View file

@ -1125,7 +1125,7 @@ CUI::EPopupMenuFunctionResult CLayerTiles::RenderCommonProperties(SCommonPropSta
} }
} }
if(HasModifiedColor) if(HasModifiedColor && !pLayer->IsEntitiesLayer())
{ {
int Color = 0; int Color = 0;
Color |= pLayer->m_Color.r << 24; Color |= pLayer->m_Color.r << 24;

View file

@ -45,6 +45,7 @@ void CLayers::Init(class IKernel *pKernel)
if(pLayer->m_Type == LAYERTYPE_TILES) if(pLayer->m_Type == LAYERTYPE_TILES)
{ {
CMapItemLayerTilemap *pTilemap = reinterpret_cast<CMapItemLayerTilemap *>(pLayer); CMapItemLayerTilemap *pTilemap = reinterpret_cast<CMapItemLayerTilemap *>(pLayer);
bool IsEntities = false;
if(pTilemap->m_Flags & TILESLAYERFLAG_GAME) if(pTilemap->m_Flags & TILESLAYERFLAG_GAME)
{ {
@ -66,6 +67,7 @@ void CLayers::Init(class IKernel *pKernel)
m_pGameGroup->m_ClipH = 0; m_pGameGroup->m_ClipH = 0;
} }
IsEntities = true;
//break; //break;
} }
if(pTilemap->m_Flags & TILESLAYERFLAG_TELE) if(pTilemap->m_Flags & TILESLAYERFLAG_TELE)
@ -75,6 +77,7 @@ void CLayers::Init(class IKernel *pKernel)
pTilemap->m_Tele = *((int *)(pTilemap) + 15); pTilemap->m_Tele = *((int *)(pTilemap) + 15);
} }
m_pTeleLayer = pTilemap; m_pTeleLayer = pTilemap;
IsEntities = true;
} }
if(pTilemap->m_Flags & TILESLAYERFLAG_SPEEDUP) if(pTilemap->m_Flags & TILESLAYERFLAG_SPEEDUP)
{ {
@ -83,6 +86,7 @@ void CLayers::Init(class IKernel *pKernel)
pTilemap->m_Speedup = *((int *)(pTilemap) + 16); pTilemap->m_Speedup = *((int *)(pTilemap) + 16);
} }
m_pSpeedupLayer = pTilemap; m_pSpeedupLayer = pTilemap;
IsEntities = true;
} }
if(pTilemap->m_Flags & TILESLAYERFLAG_FRONT) if(pTilemap->m_Flags & TILESLAYERFLAG_FRONT)
{ {
@ -91,6 +95,7 @@ void CLayers::Init(class IKernel *pKernel)
pTilemap->m_Front = *((int *)(pTilemap) + 17); pTilemap->m_Front = *((int *)(pTilemap) + 17);
} }
m_pFrontLayer = pTilemap; m_pFrontLayer = pTilemap;
IsEntities = true;
} }
if(pTilemap->m_Flags & TILESLAYERFLAG_SWITCH) if(pTilemap->m_Flags & TILESLAYERFLAG_SWITCH)
{ {
@ -99,6 +104,7 @@ void CLayers::Init(class IKernel *pKernel)
pTilemap->m_Switch = *((int *)(pTilemap) + 18); pTilemap->m_Switch = *((int *)(pTilemap) + 18);
} }
m_pSwitchLayer = pTilemap; m_pSwitchLayer = pTilemap;
IsEntities = true;
} }
if(pTilemap->m_Flags & TILESLAYERFLAG_TUNE) if(pTilemap->m_Flags & TILESLAYERFLAG_TUNE)
{ {
@ -107,6 +113,12 @@ void CLayers::Init(class IKernel *pKernel)
pTilemap->m_Tune = *((int *)(pTilemap) + 19); pTilemap->m_Tune = *((int *)(pTilemap) + 19);
} }
m_pTuneLayer = pTilemap; m_pTuneLayer = pTilemap;
IsEntities = true;
}
if(IsEntities)
{ // Ensure default color for entities layers
pTilemap->m_Color = CColor(255, 255, 255, 255);
} }
} }
} }