Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2021-08-21 00:00:00Z and 2021-08-22 00:00:00Z
Avatar
I have now released my python bindings for twmap https://gitlab.com/Patiga/twmap-py ! Every part of the map can be read, however only the map info is currently writable. You can try it out by installing it with pip install twmap and using help on the module and the different types. Currently you can only use it on linux, but I'm trying to figure out how to get them to windows as well
Avatar
chillerdragon BOT 2021-08-21 10:39:09Z
first stargazer! fan #1
Avatar
chillerdragon BOT 2021-08-21 13:32:56Z
anyone else having trouble to build on macOS ?
Avatar
[quakenet] ChillerDragon BOT 2021-08-21 13:33:36Z
/Users/chillerdragon/Desktop/git/teeworlds/src/engine/external/pnglite/version:1:1: error: expected unqualified-id
13:33
0.1.17
13:33
^
Avatar
hmhm, might take a look for reference for my Go package :0.
13:54
sounds?
13:54
why is there a sounds file Oo
Avatar
its also for ddnet maps, those can include audio files and place sounds into maps
Avatar
chillerdragon BOT 2021-08-21 15:14:26Z
@jxsl13: care the license axaxax if your code stealing gets to close u might have to inherirt lgpl or @Patiga will haunt you with lawyers
Avatar
different language, different code
15:15
different structures
16:02
this :0
Avatar
@Patiga could you explain this construct to me? #[derive(Debug, PartialEq, Clone, Serialize, Deserialize)] // for holding compressed data, since decompression is expensive pub enum CompressedData<T, U> { Compressed(Vec<u8>, usize, U), Loaded(T), }
16:40
decompressing the zlib compressed data in the map file is the most time consuming process by far
16:40
thats why I keep the tile map layer data and image/sound data compressed
16:40
(until you need it, at which point you use the method .load())
16:41
the enum you see either holds the loaded type, for example RgbaImage or Array2<Tile>, or the compressed data with some information which is required to construct the loaded type
16:42
Vec<u8> is the compressed data, usize is the expected decompressed size, U is the generic type which has the load info (for example width + height of image)
Avatar
I think loading all ddnet maps is about ~10 times faster if you keep the those things compressed
Avatar
gotta look at how this is used, I somehow fail to grasp the concept of that enum structure
16:48
if I was not caring about performance at all, what would be the equivalent?
Avatar
right after the parsing process, all layers will have CompressedData::Compressed(, , TilesLoadInfo). the zlib compressed data is just copied over when you want to use the tiles, you need to use the load method, which will go through the decompression and give you the CompressedData::Loaded(Tiles)
16:49
the alternative would be T ^^
16:50
you just would leave that enum out
Avatar
I think it's ore of a syntactical issue that I don't get that, as those Compressed/Loaded look more like functions to me. maybe this thing is somewhat comparable to a C style union?
Avatar
yea, the equivalent of enum in c is a tagged union
16:53
thanks
Exported 34 message(s)