Skip to content

Instantly share code, notes, and snippets.

@Quit
Quit / RP.Unwrp2016.cs
Created August 6, 2016 10:01
Extracts Stonehearth .smods in a semi-efficient way, auto-commits to git if configured
using System;
using System.Linq;
using System.Threading.Tasks;
using System.IO;
using System.Diagnostics;
namespace RP.Unwrp2016
{
class Program
{
local jelly_console
local MOD = class()
function MOD:__init()
radiant.events.listen(radiant, 'radiant:modules_loaded', self, self.on_loaded)
end
function MOD:on_loaded(...)
-- Use rawget to avoid strict lua getting all upset
#include "lgColor.hpp"
namespace gle {
namespace lgColor {
COLOR_CLASS& checkColor(lua_State* L, int idx) {
return *gle::getObject<COLOR_CLASS>(L, idx).object();
}
COLOR_CLASS optColor(lua_State* L, int idx, Gosu::Color defaultColor) {
if (lua_isnoneornil(L, idx))
@Quit
Quit / lDraw.hpp
Created September 26, 2012 10:22
#include "LuaObject.hpp"
#include <gl/GL.h>
/**
* lDraw - draw. Library
**/
namespace gle {
namespace lDraw {
// drawRect(x, y, w, h, z, color1, c2 = nil, c3 = nil, c4 = nil)
@Quit
Quit / LuaObject.hpp
Created September 7, 2012 00:09
Current version of the lua wrapper, + debugging stuff and a bit lacking documentation
#pragma once
#include "lua/lua.h"
#include "lua/lauxlib.h"
#include <cassert>
namespace gle {
//! Wrapper base class - no need to initiate those.
class LuaObjectBase {