CLayerTiles
struct? I know that void CLayerTiles::FillGameTiles(EGameTileOp Fill)
exists, but is there a more general way to take one CLayerTile
and only keep the tiles requested? For example, only keeping every tile that has an index of 1.sizeof (CTile)
is hardcoded in there when loading the map, weirdcpp
Pos = vec2(100.0f, 0.0f);
MaxDistance = 500.0f;
Pos *= length(Pos) * 1000.0f / (float)MaxDistance;
assert(length(Pos) * 1000.0f / (float)MaxDistance == 100.0f * 1000.0f / 500.0f);
assert(length(Pos) * 1000.0f / (float)MaxDistance == 200.0f);
assert(Pos == vec2(100.0f * 200.0f, 0.0f);
SELECT m.Map, COUNT(*) as FinishesOnFirstDayOfRelease, m.Timestamp as ReleaseDate FROM race r JOIN maps m ON r.Map = m.Map AND unixepoch(r.Timestamp) - unixepoch(m.Timestamp) < 86400 AND unixepoch(r.Timestamp) - unixepoch(m.Timestamp) > 0 GROUP BY m.Map ORDER BY FinishesOnFirstDayOfRelease DESC LIMIT 10;
Top 10 most popular maps on first day of releasecommon.h
from ddnet_protocol
lib common.h
and kernel stdlib header fileBLOAT
macro to be something like code space or something, so it will be either user space, or kernel space#define KERNEL_SPACE 1
#define USER_SPACE 2
#if CODE_SPACE == KERNEL_SPACE
// blah blah
#elif CODE_SPACE == USER_SPACE
// blah blah
#elif !defined(CODE_SPACE)
#error \
"CODE_SPACE is not defined. Define it to `KERNEL_SPACE` or `USER_SPACE`."
#else
#error \
"CODE_SPACE has invalid value, it must be `KERNEL_SPACE` or `USER_SPACE`."
#endif
How cursed is this?#define KERNEL_SPACE 1
#define USER_SPACE 2
#if CODE_SPACE == KERNEL_SPACE
// blah blah
#elif CODE_SPACE == USER_SPACE
// blah blah
#elif !defined(CODE_SPACE)
#error \
"CODE_SPACE is not defined. Define it to `KERNEL_SPACE` or `USER_SPACE`."
#else
#error \
"CODE_SPACE has invalid value, it must be `KERNEL_SPACE` or `USER_SPACE`."
#endif
How cursed is this? CHeap
chunk (65600 bytes) due to the line data being written outside the heap chunk.
This is fixed by allowing CHeap
to allocate chunks as large as necessary to contain at least one item.
As an alternative the CHeap
functions could be changed to return nullptr
if the wanted allocation is too large, which would have to be handled explicitly when ...#define KERNEL_SPACE 1
#define USER_SPACE 2
#if CODE_SPACE == KERNEL_SPACE
// blah blah
#elif CODE_SPACE == USER_SPACE
// blah blah
#elif !defined(CODE_SPACE)
#error \
"CODE_SPACE is not defined. Define it to `KERNEL_SPACE` or `USER_SPACE`."
#else
#error \
"CODE_SPACE has invalid value, it must be `KERNEL_SPACE` or `USER_SPACE`."
#endif
How cursed is this? common.h
file https://github.com/MilkeeyCat/ddnet_protocol/blob/master/include/ddnet_protocol/common.h, BLOAT
macro means whether to use glibc header files or define used functions as extern
so they can be implemented the the code base where the lib is used. But it doesn't really work, because in my kernel module I use linux/types.h
header file which declares true
and false
enums values. And the values are declared again if BLOAT
macro is not defined. I want to refactor common.h
to include necessary header files to not redeclare bool values./afk
, closes #9270. Guess we need more discussion this time.
common.h
file https://github.com/MilkeeyCat/ddnet_protocol/blob/master/include/ddnet_protocol/common.h, BLOAT
macro means whether to use glibc header files or define used functions as extern
so they can be implemented the the code base where the lib is used. But it doesn't really work, because in my kernel module I use linux/types.h
header file which declares true
and false
enums values. And the values are declared again if BLOAT
macro is not defined. I want to refactor common.h
to include necessary header files to not redeclare bool values.