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 json = require "dkjson" | |
local len = string.len | |
local insert = table.insert | |
local remove = table.remove | |
local concat = table.concat | |
local stringify = json.encode | |
local parse = json.decode | |
local compress = love.data.compress | |
local decompress = love.data.decompress |
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 moonscript = require "moonscript" | |
-- Add package loader for love.filesystem moon scripts. | |
table.insert(package.loaders, 2, function (name) | |
local name_path = name:gsub("%.", "/") | |
local file_path, text | |
for path in love.filesystem.getRequirePath():gsub("%.lua", ".moon"):gmatch("[^;]+") do | |
file_path = path:gsub("?", name_path) | |
text = love.filesystem.read(file_path) | |
if text then |
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
# FindZIP.cmake - Pack and unpack ZIP files as custom targets | |
# ------------------------------------------------------------------------------ | |
# Provides: | |
# | |
# ZIP_PACK_TARGET TARGET WORKING_DIRECTORY ARCHIVE FILES... | |
# TARGET - The name of the custom target | |
# WORKING_DIRECTORY - The working directory for the zip command | |
# ARCHIVE - The full archive path | |
# FILES... - The files and directories to include in the archive | |
# (relative to WORKING_DIRECTORY) |
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
# FindMoonscript.cmake - Compile Moonscript as a custom target | |
# ------------------------------------------------------------------------------ | |
# Provides: | |
# | |
# MOONSCRIPT_COMPILE_TARGET TARGET WORKING_DIRECTORY OUT_DIR FILES... | |
# TARGET - The name of the custom target | |
# WORKING_DIRECTORY - The working directory for the moonc command | |
# OUT_DIR - The directory to store compiled .lua files | |
# FILES... - The .moon files to compile (relative to WORKING_DIRECTORY) | |
# |
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
# FindLuamin.cmake - Minify Lua code as a custom target | |
# ------------------------------------------------------------------------------ | |
# Provides: | |
# | |
# LUAMIN_MINIFY_TARGET TARGET WORKING_DIRECTORY OUT_DIR FILES... | |
# TARGET - The name of the custom target | |
# WORKING_DIRECTORY - The working directory for the luamin command | |
# OUT_DIR - The directory to store minified .lua files | |
# FILES... - The .lua files to minify (relative to WORKING_DIRECTORY) | |
# |
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
#include <stdio.h> | |
#include <curl/curl.h> | |
/* ===== HELPER FUNCTIONS ================================================= */ | |
static size_t writeToFile(void *ptr, size_t size, size_t nmemb, FILE *stream) { | |
size_t written; | |
written = fwrite(ptr, size, nmemb, stream); |