This file contains 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
-- $Id: utf8.lua 179 2009-04-03 18:10:03Z pasta $ | |
-- | |
-- Provides UTF-8 aware string functions implemented in pure lua: | |
-- * string.utf8len(s) | |
-- * string.utf8sub(s, i, j) | |
-- * string.utf8reverse(s) | |
-- * string.utf8char(unicode) | |
-- * string.utf8unicode(s, i, j) | |
-- * string.utf8gensub(s, sub_len) | |
-- |
This file contains 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
#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; |
This file contains 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
/* USAGE: | |
* Timer foo; // Start the timer | |
* const TimeData &time = foo.touch(); // Update and return TimeData (delta being the time since last touch) | |
* const TimeData &time_peek = foo.peek(); // returns current TimeData only updating the current time (does not reset!) | |
* SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION | |
* | |
* I haven't actually tested peek, but it looks right... */ | |
#pragma once | |
#include <SDL.h> |
This file contains 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 "hemicube.h" | |
#define PACK_HEMICUBES 1 | |
static void get_hemicube_face_normal(int index, Vector3 *forward, Vector3 *left, Vector3 *up) { | |
// Unwrapped hemicube with positive-Z in the middle. | |
switch (index) { | |
case 0: *forward = Vector3(+1, 0, 0); *left = Vector3( 0, 1, 0); break; |
This file contains 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
function gate(axis, num) | |
local function wrap(x) | |
return math.fmod(x, math.pi * 2) | |
end | |
if math.abs(axis.x) < 0.1 and math.abs(axis.y) < 0.1 then | |
return num + 1 | |
end | |
local angle = math.atan2(axis.y, axis.x) -- in radians |
This file contains 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 <iostream> | |
#include <vector> | |
#include <string> | |
#include <stdexcept> | |
#include <clocale> | |
#include <cstring> | |
#include <cwchar> | |
#include <cmath> | |
#include <cstdio> |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using SharpDX; | |
using SharpDX.D3DCompiler; | |
using SharpDX.Direct3D; | |
using SharpDX.Direct3D11; | |
using SharpDX.DXGI; | |
using SharpDX.Windows; |
This file contains 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
// Mini memory editor for Dear ImGui (to embed in your game/tools) | |
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112 | |
// THE MEMORY EDITOR CODE HAS MOVED TO GIT: | |
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor | |
// Click "Revisions" on the Gist to see old version. |
This file contains 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
:: Removes most telemetry/data collection/potentially unwanted behavior from Windows 7 | |
:: Disables the automatic download of Windows 10 | |
:: Note : be careful to keep KB in descending order | |
:: Comment that line to restore prompts for uninstall/reboot | |
:: Thanks to https://gist.github.com/geoffroyjabouley | |
set WUSA_OPTIONS=/quiet /norestart | |
:: Removes Windows 7-8.1 telemetry (part 1) | |
wusa %WUSA_OPTIONS% /uninstall /kb:3080149 |
This file contains 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
-- NES Hardware Sprite Visualizer (for BizHawk) | |
-- v01 | |
-- by thefox <[email protected]> 2015-09-15 | |
-- NOTE: Requires NesHawk core | |
------------------------------------------------------------------------------- | |
-- Memory domains on NES: | |
-- WRAM, CHR, CIRAM (nametables), PRG ROM, PALRAM, OAM, System Bus, RAM |
OlderNewer