This file contains hidden or 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
-- Stack.lua | |
-- Last in, first out | |
-- poopbarrel/magicoal_nerb :^) | |
local Stack = {} | |
Stack.__index = Stack; | |
function Stack.new(capacityPow) | |
local mask = bit.lshift(1, capacityPow) - 1 | |
-- create an array beforehand so lua doesn't |
This file contains hidden or 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
-- Xml.lua | |
-- Parses xml files | |
-- poopbarrel/magicoal_nerb :^) | |
-- This parser makes a few assumptions about our data: | |
-- * element tags are not separated by whitespace | |
-- * no comments | |
local Stack = require("Stack") | |
local ffi = require("ffi") |
This file contains hidden or 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
--!strict | |
--!native | |
-- Chunk.luau | |
-- Uses a binary greedy mesher to chunk | |
-- everything together. | |
-- poopbarrel/magicoal_nerb | |
local CHUNK_FACES: { Vector3 } = { | |
Vector3.xAxis, |
This file contains hidden or 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
--!strict | |
-- poopbarrel/magical_noob | |
-- @submodule quakec | |
-- @description another quake movement reimplementation ig | |
-- Physics | |
local XZ: Vector3 = Vector3.new(1.0, 0.0, 1.0) | |
local CAPSULE_FLOOR_ANGLE: number = 0.7 |
This file contains hidden or 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
-- Average stack based JSON parser i guess | |
local LEX_CLASSIFIER = { | |
8, 8, 8, 8, 8, 8, 8, 8, 8, 40, 40, 40, 40, 40, 8, 8, 8, | |
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 160, 16, 16, 16, | |
16, 16, 16, 16, 16, 16, 16, 16, 16, 66, 16, 16, 4, 4, 4, 4, 4, | |
4, 4, 4, 4, 4, 16, 16, 16, 16, 16, 16, 16, 65, 65, 65, 65, 65, | |
65, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
1, 16, 16, 16, 16, 16, 16, 66, 66, 66, 66, 66, 66, 2, 2, 2, 2, | |
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, | |
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
This file contains hidden or 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
// Note, bsf/bsr are used by default. | |
// Enable /arch:AVX2 compilation for better optimizations | |
#if defined(_MSC_VER) && !defined(__clang__) | |
#include <intrin.h> | |
#include <limits.h> | |
#if (defined(__cplusplus) && (__cplusplus >= 202002L)) || \ | |
(defined(_MSVC_LANG) && (_MSVC_LANG >= 202002L)) | |
#include <type_traits> |