Skip to content

Instantly share code, notes, and snippets.

#include <stdexcept>
#include <Windows.h>
#include <Psapi.h>
#include <detours.h>
#include <d3d9.h>
#include <d3dx9.h>
#define PI 3.14159F
char **game_ptr;
#include <Windows.h>
#include <TlHelp32.h>
#include <Psapi.h>
int main()
{
const auto *exe = "GuiltyGearXrd.exe";
const auto *dll = "ggxrd_hitbox_overlay.dll";
const auto snap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
@Midiman
Midiman / skullgirls_cmdline.txt
Last active August 29, 2015 14:14 — forked from shakesoda/gist:9506865
Skullgirls commandline options
-enablereplays : Enable replays in the retail version of Skullgirls
-c config_file : Use the specified configuration file instead of the default
-defaultkeys : Reset all keybinds
-log : Enable logging
-fs : Run in fullscreen
-fw : Run in fullscreen windowed
-res blahxblah : Set the screen resolution, where blah is a a number
-sc : Set the screen rendering scale; useless?
-ignorefocus : Let's the game take input despite not being focused
-vjoyfix : always poll joystick pov hats? I don't know the context of this. irc says ps3 controllers
CC := clang
TARGET := game
AL_CFLAGS := -Ilib/allegro/include
AL_LDFLAGS := -Llib/allegro/lib
GLIB_CFLAGS := -Ilib/glib -Ilib/glib/glib
GLIB_LDFLAGS := -Llib/glib/glib/.libs
CFLAGS := -g -Wall $(AL_CFLAGS) $(GLIB_CFLAGS)
LDFLAGS := $(AL_LDFLAGS) $(GLIB_LDFLAGS)
#define MAX_CONTROLLERS 4
class JoypadController {
public:
JoypadController() : m_is_connected(false), m_gamepad(0), m_instance_id(-1), m_haptic(0) {}
int JoypadController::processEvent(const SDL_Event& event);
private:
SDL_GameController *m_gamepad;
SDL_Haptic *m_haptic;
Graph = {}
Graph.__index = Graph
function Graph.new()
return setmetatable({adjacency_list = {}, nodes = {}, edges = {}, floyd_dists = {}}, Graph)
end
function Graph:__tostring()
local str = "----\nAdjacency List: \n"
for node, list in pairs(self.adjacency_list) do
@Midiman
Midiman / ld28.dart
Created December 16, 2013 04:27 — forked from flexd/ld28.dart
library ld28;
import 'dart:html';
import 'dart:math' as Math;
import 'dart:web_gl' as WebGL;
import 'dart:typed_data';
import 'package:vector_math/vector_math.dart';
part 'shader.dart';
@Midiman
Midiman / getPSO.lua
Created November 25, 2013 11:04 — forked from a327ex/getPSO.lua
function getPSO(filename)
local templates = loadstring("return " .. love.filesystem.read(filename))()
local pss = {}
local degToRad = function(d) return d*math.pi/180 end
local getPS = function(template)
local sprite = love.graphics.newImage('your_default_sprite_here.png')
local ps = love.graphics.newParticleSystem(sprite, template.buffer_size)
ps:setBufferSize(template.buffer_size)
local colors = {}
for i = 1, 8 do
data:text/html,<div class="wrap"> <h1>Todo<span>, no fuss lists</span></h1> <input placeholder="Add a todo" type="text" id="item" /> <button id="go">Save</button> <span class="help">* tap to delete</span> <ul id="tudu_list"> </ul> </div><script type="text/javascript">var tudu_list = document.getElementById('tudu_list'); var item = document.getElementById('item'); var new_li; var new_obj = {}; function prependElement(parentID,child) { parent=parentID; parent.insertBefore(child,parent.childNodes[0]); } function remove(element){ element.parentNode.removeChild(element); } function deleteItem(){ var answer = confirm('Sure you want to remove this?'); if(answer){ var deleteId = this.getAttribute('rel'); remove(this); } } function addItem(){ if(item.value !== ''){ new_li = document.createElement('li'); new_li.innerHTML = item.value; prependElement(tudu_list, new_li); new_li.onclick = deleteItem; item.value = ''; } } function callAdd(e){ if(event.keyCode == 13){ addItem(); } } item.onkeyup = function(e){ callAdd(e) };
#include <map> // Component-entity system in 24 lines of C++11. 2013 rlyeh, MIT licensed.
#include <set> // Code fragment from kult engine - https://github.com/r-lyeh/kult
enum SUBSYSTEM_MODE { JOIN = 0, MERGE = 1, EXCLUDE = 2 };
template<typename T> std::set<unsigned> &system()
{ static std::set<unsigned> entities; return entities; }
template<typename T, int MODE> std::set<unsigned> subsystem( const std::set<unsigned> &B )
{ std::set<unsigned> newset; const std::set<unsigned> &A = system<T>(); // union first,
/**/ if (MODE == MERGE) { newset = B; for( auto &id : A ) newset.insert(id); } // then difference,
else if (MODE == EXCLUDE) { newset = B; for( auto &id : A ) newset.erase (id); } // then intersection
else if(A.size() < B.size()) { for( auto &id : A ) if(B.find(id) != B.end()) newset.insert( id ); }