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
See https://gist.github.com/tilkinsc/7f383faccf3722622f5d0cc9bd45e7e6 |
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
local class = {} | |
-- Derived from: http://lua-users.org/wiki/CopyTable | |
-- Copies a table | |
local shallowcopy = function(o) | |
local c = {} | |
if (type(o) ~= "table")then | |
c = o | |
return c |
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
/** | |
* | |
* MIT License | |
* | |
* Copyright (c) 2017-2022 Cody Tilkins | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
enum DDSD | |
{ | |
NONE = 0x00, | |
CAPS = 0x01, | |
HEIGHT = 0x02, | |
WIDTH = 0x04, | |
PITCH = 0x08, | |
PIXELFORMAT = 0x1000, | |
MIPMAPCOUNT = 0x20000, | |
LINEARSIZE = 0x80000, |
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
using System.Runtime.InteropServices; | |
namespace Util; | |
class TwoWayMemoryStream : MemoryStream | |
{ | |
private byte[] _buffer; | |
private TwoWayMemoryStream() |
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
using System.Text.Json; | |
namespace Meerkat.Json; | |
public interface IJSONSerializable | |
{ | |
} | |
/// <summary> | |
/// Implements the ability to load JSON files. By default, if the json file |
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
local sub = string.sub | |
local concat = table.concat | |
local insert = table.insert | |
string.where = function(self, predicate) | |
local buf = {} | |
for i = 1, #self do | |
local ch = sub(self, i, i) | |
if (predicate(ch)) then | |
insert(buf, ch) | |
end |
OlderNewer