Skip to content

Instantly share code, notes, and snippets.

@Sturmlilie
Sturmlilie / win32-rpath-writeup.md
Last active November 13, 2020 00:11
rpath shenanigans on win32

(Draft; this ended up working for a big Qt5 app, but not a simple test exe for whatever reason, so beware)

When creating a stand alone application on windows, the problem of bundling dynamically linked libraries arises, because by default, the linker only checks a system wide path and the folder containing the executable. Most people don't concern themselves with this too much and just dump all their dlls into the folder together with the exe, but this makes for a really miserable user experience, especially when the number of dlls is more than a handful. Ideally, we want to stash all libraries into a subdirectoy, everything else (assets etc.) into separate subdirectories, and only leave the executable at the top. On Linux, this would be very easy to achieve: we could just pass -rpath=$ORIGIN/lib to ld, and the dynamic linker would always check the "lib" folder relative to the executable when resolving .so's. In fact, this mechanism is the bread-and-butter of independently distributed proprietary games o

@Sturmlilie
Sturmlilie / pw_door.tis3d
Last active October 30, 2020 15:27
Fibercraft password-protected door
User-facing cluster, IN = input (terminal), STK = stack, TEST = digest output (infrared)
The hash algo is roughly equivalent to
int digest = 0;
for (ch in input) {
int val = ch ^ (ch & 0x0101 ? (ch << 4) : 0) ^ ch << 8;
digest ^= val;
}
#DEFINE IN UP
@Sturmlilie
Sturmlilie / ancurio_cv.md
Last active August 23, 2021 12:52
An in-depth resume on my open source work

Who am I?

I am a human being first, Backend and Embedded Engineer second, interested in making things work, contributing to communities, and making the world a better place; most of the projects I have dedicated my free and paid time towards will reflect this.

Skills

My strengths lie in native environments in which there is at least a hint of emphasis on resource management, as well as learning and adapting to new frameworks. I believe my biggest project, a free reimplementation of a popular 2D game engine, reflects these attributes. I am comfortable with C/C++, and have experience with Ruby and Java.

Roles I enjoy

I enjoy roles that will allow me to apply my application development skills to products and services which bring value to communities and individuals. I value empowering people through software. Alternatively I also love working on tooling that makes other developers' lives easier.

@Sturmlilie
Sturmlilie / duyguji_preliminary
Last active July 14, 2020 19:46
Preliminary outline for Duyguji
Uncode emoji (separate mod): All of these have codepoints allocated by the Unicode Consortium, which don't have to be touched. For rendering, the existing resource pack infrastructure Mojang provides and which was recently updated to allow full UTF-16 (up to codepoint 0x10FFFF) fonts is used. Since the coverage between the existing permissively licensed emosets differs, the idea is to have multiple sets installed, each as one individual resource pack, (eg. one main and one for fallback) which are queried for glyphs in descending priority. The priority is to be configurable by the user in an approriate graphical interface.
Unfortunately there are some bugs in Mojangs code that have to be remidied for this to work correctly.
Custom emopacks (separate mod): One emopack (packaged as a single datapack) defines up to 256 emojis and is allocated exactly one unicode block in one of the two private use planes (0xFXXXX and 0x10XXXX). Since emojis can be part of persistent texts (nametags, signs etc.), the mapping of o
@Sturmlilie
Sturmlilie / apitrace-tutorial.md
Last active April 4, 2024 17:09
Debugging OpenGL issues in Minecraft mods using apitrace

Apitrace tutorial

Debugging OpenGL issues in Minecraft mods using apitrace

In the transition of Minecraft version 1.14 to 1.15, Mojang introduced some sweeping changes to the way rendering is performed; while the internal code still relies on GL1-era immediate-mode, block and entity renderer classes now provide their vertices to a specific RenderLayer* which are later rendered in ordered batches.

These changes broke a majority of Minecraft mods; in the process of porting a mod to 1.15, I had to frequently rely on a tool called “apitrace”, and I thought a quick how-to might come in handy for others struggling with similar problems. Apitrace allows capturing every OpenGL call an application makes, and later replaying these calls and inspecting the entire GL state machine at each rendering step.

For this tutorial, I am using the MultiMC launcher.

First step: Install apitrace