Skip to content

Instantly share code, notes, and snippets.

View flibitijibibo's full-sized avatar

Ethan Lee flibitijibibo

View GitHub Profile
@flibitijibibo
flibitijibibo / flibitSave.c
Last active November 21, 2017 23:31
flibit's XDG/OSX Save and Config Folder Thing
/* XDG/OSX Save and Config Folder Thing
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
#include <stdio.h>
#include <stdlib.h>
@flibitijibibo
flibitijibibo / GameName.sh
Created April 11, 2013 16:58
A variant of this launcher ships in every game I've worked on. While the filename here is GameName.sh, I do not use the .sh extension. Just `chmod +x` this and put your OSX bins in osx/, Linux 32-bit bins in x86/, and Linux 64-bit bins in x86_64/.
#!/bin/bash
# GameName Shell Script
# Written by Ethan "flibitijibibo" Lee
# Move to script's directory
cd "`dirname "$0"`"
# Get the kernel/architecture information
UNAME=`uname`
ARCH=`uname -m`
@flibitijibibo
flibitijibibo / Makefile
Created April 27, 2013 14:02
Why do I even have this
# Makefile for "int main;" C Program
# Written by Ethan "flibitijibibo" Lee
ifeq ($(shell uname), Darwin)
ASMPARAM = -mllvm --x86-asm-syntax=intel
else
ASMPARAM = -masm=intel
endif
all:
public class SomeThang
{
int whoCares;
public SomeThang(int whatever)
{
whoCares = whatever;
}
static public implicit operator bool(SomeThang someThang)
{
@flibitijibibo
flibitijibibo / NotProgram.cs
Created June 25, 2014 20:26
FNA Save Migration Code Pile
/* This is a snippet of code from the FNA version of Rogue Legacy.
*
* A recent FNA update fixed Storage accuracy, affecting save locations:
* https://plus.google.com/102593483001615978126/posts/7qE6nJGcdL2
* As a result, games like Rogue Legacy now need a migration process.
*
* This is the first one I've written, and I'm posting it here for when
* I take care of the rest of my affected ports.
*
* -flibit
@flibitijibibo
flibitijibibo / SpriteBatchTest.cs
Created July 26, 2014 16:16
SpriteBatch Stress Test
/* SpriteBatch Stress Test
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
using System;
using System.Diagnostics;
@flibitijibibo
flibitijibibo / SpriteFontTest.cs
Created July 26, 2014 16:17
SpriteFont Accuracy Test
/* SpriteFont Accuracy Test
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
@flibitijibibo
flibitijibibo / FNAWindowExample.cs
Last active April 30, 2022 15:21
Example to hook up an SDL2 window to a Panel for use in a System.Windows.Forms window
#region License
/* FNA GameWindow for System.Windows.Forms Example
* Written by Ethan "flibitijibibo" Lee
* http://www.flibitijibibo.com/
*
* Released under public domain.
* No warranty implied; use at your own risk.
*/
#endregion
@flibitijibibo
flibitijibibo / SDL_DeckLink.cpp
Last active December 5, 2020 17:51
A quick and dirty application that lets me stream from an Intensity Pro into an SDL/OpenGL window.
@flibitijibibo
flibitijibibo / SDL_GameController.txt
Last active November 1, 2015 23:20
These changes allow for a working experience out of the box with SDL_GameController.
export SDL_GAMECONTROLLERCONFIG="0600000057696920552047616d655000,Wii U GamePad (libdrc),platform:Linux,x:b12,a:b14,b:b15,y:b13,back:b2,guide:b1,start:b3,dpleft:b11,dpdown:b8,dpright:b10,dpup:b9,leftshoulder:b5,lefttrigger:b7,rightshoulder:b4,righttrigger:b6,leftstick:b23,rightstick:b22,leftx:a0,lefty:a1,rightx:a2,righty:a3,"