Field | Value |
---|---|
DIP: | |
Author: | Richard (Rikki) Andrew Cattermole ([email protected]) |
Implementation: | |
Status: | Draft |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const assert = @import("std").debug.assert; | |
fn compressBlock(writer: anytype, src: []const u8) !void { | |
var table = [_]u32{0} ** 4096; // size is pow2. bump to match more. ideal = (0xffff+1) / sizeof(u32) | |
var anchor: u32 = 0; | |
if (src.len > 12) { // LZ4 spec restriction: last match must start 12b before end of block. | |
var pos: u32 = 0; | |
while (pos + 4 < src.len - 5) { // LZ4 spec restriction: last 5b are always literal. | |
const blk: u32 = @bitCast(src[pos..][0..4].*); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wonder Boy: The Dragon's Trap | |
----------------------------- | |
Quick Guide for programmers | |
Last updated October 2018 | |
Contact: Omar Cornut <XXXXXX | |
=============================================== | |
INDEX | |
=============================================== |
Original Author: Rui Ueyama (creator of the mold linker)
Translated by @windowsboy111
Minimally edited by @lleyton
Some time ago I read the @lisyarus' post about his UI library. In his blog post he compares existing UI frameworks, analyses reasons why they don't work to them, and shows how he created his own library to build in-game UI.
His blog post immediately inspired me: how would I build my UI library?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn LexicographicHashMap(comptime V: type, comptime capacity: u32) type { | |
const shift = @bitSizeOf(u64) - 1 - std.math.log2_int(u64, capacity) + 1; | |
const overflow = capacity / 10 + (@bitSizeOf(u64) - 1 - shift + 1) << 1; | |
const num_entries = capacity + overflow; | |
return struct { | |
pub const Entry = packed struct { | |
key: u32 = 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const sparse = @This(); | |
/// This is an implementation of a paged sparse set that stores the payload in | |
/// the sparse array. | |
// | |
/// A sparse set has a dense and a sparse array. The sparse array is directly | |
/// indexed by a 64 bit identifier. The sparse element is linked with a dense | |
/// element, which allows for liveliness checking. The liveliness check itself |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env scheme --script | |
(import (nanopass)) | |
(define unique-var | |
(let () | |
(define count 0) | |
(lambda (name) | |
(let ([c count]) | |
(set! count (+ count 1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bench_path.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "entt.hpp" | |
#define MILLION (1000 * 1000) | |
#define BILLION (1000 * MILLION) | |
#define ENTITY_COUNT (255) | |
#define COMPONENT_COUNT (10) |
NewerOlder