Page 1 of 1

DDnet Sourcecode help

Posted: Sun Jun 25, 2017 12:19 pm
by Logo
Hey everyone,

I just started to work me in the subject of Unsupervised Learning and I want to practice on a practial example.
So I started to study the ddnet sourcecode. But I just don't get how the Map is stored internally or rather how to access the current map. I need something like coords of each tile of the different layers.
I hope someone could help me.

Logo

Re: DDnet Sourcecode help

Posted: Sun Jun 25, 2017 12:55 pm
by deen

Code: Select all

src/game/layers.* CLayer
src/game/mapitems.h CMapItemLayerTilemap and CTile

m_Width = m_pLayers->GameLayer()->m_Width;
m_Height = m_pLayers->GameLayer()->m_Height;
CTile* m_pTiles = static_cast<CTile *>(m_pLayers->Map()->GetData(m_pLayers->GameLayer()->m_Data));
if(m_pTiles[pos].m_Index >= TILE_SOLID && m_pTiles[pos].m_Index <= TILE_NOLASER)

Re: DDnet Sourcecode help

Posted: Sun Jun 25, 2017 3:53 pm
by Logo
thanks

thats what I was searching for (: