Skip to content

Instantly share code, notes, and snippets.

View JulianDicken's full-sized avatar
🦐

Julian Dicken JulianDicken

🦐
  • Sweden
  • 00:19 (UTC +02:00)
View GitHub Profile
@JulianDicken
JulianDicken / animcurve_copy_channel.gml
Last active May 3, 2022 18:31
animcurve_copy_channel
function animcurve_copy_channel(src, dst) {
static __animcurve_copy_channel = function(n, src, dst) {
gml_pragma("forceinline");
var i = -1; repeat(n) { ++i;
dst.points[i].value = src.points[i].value;
dst.points[i].posx = src.points[i].posx;
}
}
var n = array_length(src.points);
var m = array_length(dst.points);
@JulianDicken
JulianDicken / generate_uuid4_string.gml
Created July 16, 2021 11:31
A UUID4 String Generator for GML
function generate_uuid4_string() {
//As per https://www.cryptosys.net/pki/uuid-rfc4122.html
//FIXME - Do this without random()/choose() calls
var _UUID = sha1_string_utf8(string(current_time) + string(date_current_datetime()) + string(random(0xFFFFFF)));
_UUID = string_set_byte_at(_UUID, 9, 0x2D)
_UUID = string_set_byte_at(_UUID, 14, 0x2D)
_UUID = string_set_byte_at(_UUID, 19, 0x2D)
_UUID = string_set_byte_at(_UUID, 24, 0x2D)
_UUID = string_delete(_UUID, 37, 4)
@JulianDicken
JulianDicken / costable.h
Created March 13, 2021 01:26
c++ cosine table (1dg)
static float cosLookup[360] {
1.000000f,
0.999848f,
0.999391f,
0.998630f,
0.997564f,
0.996195f,
0.994522f,
0.992546f,
0.990268f,