struct Context {
handler: Handler,
}
struct Handler {
context: Arc<Context>
}
impl Handler {
fn new(context: Arc<Context>) -> Self {
Handler { context }
}
}
let context = Context { handler: Handler::new(..); };
How would you handle something like this?struct Context {
handler: Handler,
}
struct Handler {
context: Arc<Context>
}
impl Handler {
fn new(context: Arc<Context>) -> Self {
Handler { context }
}
}
let context = Context { handler: Handler::new(..); };
How would you handle something like this? Vec<Box<dyn Module + Send + Sync>>
in it, it'll soon also have utility functions modules can use on itVec<Box<dyn Module + Send + Sync>>
in it, it'll soon also have utility functions modules can use on it struct Context {
handler: Handler,
}
struct Handler {
context: Arc<Context>
}
impl Handler {
fn new(context: Arc<Context>) -> Self {
Handler { context }
}
}
let context = Context { handler: Handler::new(..); };
How would you handle something like this? Weak
is a version of Arc
that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade
on the Weak
pointer, which returns an Option>.Vec
can store a trait object without boxVec
needs fixed sizeVec
can store a trait object without box A
is fixed sizestruct Context {
handler: Handler,
}
struct Handler {
context: Arc<Context>
}
impl Handler {
fn new(context: Arc<Context>) -> Self {
Handler { context }
}
}
let context = Context { handler: Handler::new(..); };
How would you handle something like this? Vec<&(dyn Module + Send + Sync)>
std::shared_ptr
struct Handler *
and struct Context *
Arc
because it's a memleakArc
because it's a memleak Weak
is a version of Arc
that holds a non-owning reference to the managed allocation. The allocation is accessed by calling upgrade
on the Weak
pointer, which returns an Option>.Arc
because it's a memleak Option
there and it'll create the same dependencyOption
alone, it won't work, but by adding Mutex
you could make it workOption
alone, it won't work, but by adding Mutex
you could make it work Option<>
after the creation of the Arc
anymoreContext
and Handler
?goto
may offend some developers
goto_switch [id]
. Which will set the clients view port to the first occurrence it finds of that switcher in the map. If the command ...Context
and Handler
? Context
is a set of global stuff like the SqlitePool
, the discord api client, a http client, bots current state, it's current user_id
Handler
is a handler to initialize and dispatch events to Module
s
Module
s will call back into the Handler
for registering what should be dispatched to themModule
s using utility functions in Handler
, it needs a copy of the context, I'll just think of something elseContext
and Module
s live for the entire duration of the program so it's not too too bad CMapBasedEnvelopePointAccess::SetPointsRange
function so the start point and number of points that should be considered when using this envelope point storage can be configured. In the editor, this range always includes all points, as each envelope directly stores only its own points, so animations were rendered correctly there. However, all points are stored in one array when loading them from the map file (i.e. when rendering the map ingame), so the start point and number of points sp...Weak
? Am I supposed to be upgrading it before use so I can make sure it doesn't get dropped while I'm using it?Weak
? Am I supposed to be upgrading it before use so I can make sure it doesn't get dropped while I'm using it? Weak
? Am I supposed to be upgrading it before use so I can make sure it doesn't get dropped while I'm using it? goto
m_RenderPrev
and m_RenderCur
, the client interpolates between those two so it looks smooth the the eye (edited)UI()->MouseDeltaY()
actually returns? I would expect it to return the change of the y coordinate in whatever unit all other stuff is. So that UI()->MouseDeltaY() / View.y
would give the percentage the mouse moved in the View
. It seems to work fine for x, but not for y coordinatesUI()->MouseDeltaY()
actually returns? I would expect it to return the change of the y coordinate in whatever unit all other stuff is. So that UI()->MouseDeltaY() / View.y
would give the percentage the mouse moved in the View
. It seems to work fine for x, but not for y coordinates UI()->MouseDeltaY() / Graphics()->WindowWidth()
. So I tried multiplying it with Graphics()->WindowWidth() / Graphics()->WindowHeight()
but its still offMapScreenToWorld
does pub const fn as_nanos(&self) -> u128 {
self.secs as u128 * NANOS_PER_SEC as u128 + self.nanos.0 as u128
}
u64
nanos in a Duration
, but a Duration
can have more nanos than fit into a u64
2**64-1 seconds + 10*9-1 nanoseconds
, I believem_vTextureIndices[TextureID.Id()]
m_vSpriteHelper
state variable so it's not thread-safe#
in the URLdbg_dummies 31
or 63
and reload
: https://github.com/Robyt3/ddnet/tree/Debug-Server-Dummies-Skins-KillMsglibpng: warning for file "downloadedskins/Bat.15596.tmp": iCCP: known incorrect sRGB profile
libpng: warning for file "downloadedskins/Bat.15596.tmp": iCCP: known incorrect sRGB profile
downloadedskins
folder and more than 80% of those files are .tmp
filesbluekitty .7612.tmp
bluekitty
(with a space at the end) then this should make a request to https://api.skins.tw/api/resolve/skins/bluekitty%20.png
, as confirmed by adding debug logs for this variable:
https://github.com/ddnet/ddnet/blob/3991d199667d133a220758b3e0def3e75911a1b2/src/engine/shared/http.cpp#L232
However, this actually seems to make a request to https://api.skins.tw/api/resolve/skins/bluekitty.png
(without the space), as the download is successful, hence `downloadedsk...