DDnet Sourcecode help

Request help for teeworlds-related subjects (mapping, servers, ..).
For client issues, see our repositories (https://github.com/ddnet/ddnet/issues).
Post Reply
Logo
Posts: 2
Joined: Sun Jun 25, 2017 12:10 pm
Player profile: https://ddnet.tw/players/Logo/

DDnet Sourcecode help

Post 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
User avatar
deen
TECHNICAL Team
Posts: 3576
Joined: Mon May 05, 2014 2:30 pm
Player profile: https://ddnet.org/players/deen/
Discord: deen#5910

Re: DDnet Sourcecode help

Post 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)
Logo
Posts: 2
Joined: Sun Jun 25, 2017 12:10 pm
Player profile: https://ddnet.tw/players/Logo/

Re: DDnet Sourcecode help

Post by Logo »

thanks

thats what I was searching for (:
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests