Skip to content

Instantly share code, notes, and snippets.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MobSpawner : MonoBehaviour
{
public class Trap
{
private static int ordinal = 0;
class GameObject { }
class ElementSpec
{
public int ID;
public EffectType type;
public string effectName;
public GameObject turretToSpawn;
public GameObject magicForPlayer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test
{
enum EffectType
{
class EffectList
{
class EffectTimer
{
public EffectType type;
public float timer;
};
private List<EffectTimer> effects;
@Jakz
Jakz / rotating_framebuffers.md
Last active December 20, 2019 14:45 — forked from mthuurne/rotating_framebuffers.md
Rotating framebuffers

Goals:

  • support vsynced double and triple buffering
  • zero buffer copies

User space execution flow:

  1. block on free_queue.size() > 0
  2. lock free_queue, remove top element, unlock
  3. acquire buffer handle
  4. map buffer into virtual memory region
  5. draw into buffer
@Jakz
Jakz / SDL2-blitting.cpp
Last active December 14, 2019 04:00
SDL2 basic blitting
void init() // once
{
constexpr int WIDTH = XXX;
constexpr int HEIGHT = XXX;
SDL_Surface* _output = SDL_CreateRGBSurface(0, WIDTH, HEIGHT, 32, format->Rmask, format->Gmask, format->Bmask, format->Amask);
SDL_Texture* _outputTexture = SDL_CreateTexture(renderer, format->format, SDL_TEXTUREACCESS_STREAMING, WIDTH, HEIGHT);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255);
}
@Jakz
Jakz / gist:ab294e52bffa12f8e9daeb365e868ea5
Created November 30, 2019 14:39
SDL2 bug test on RG-350
#include "SDL.h"
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <array>
int main(int argc, const char* argv[])
{
@Jakz
Jakz / nASOS.cs
Last active August 4, 2018 03:53
nASOS GC
using System;
using System.IO;
using System.Text;
namespace gcm_nasos_deux
{
class Program
{
struct gcm_info
{
@Jakz
Jakz / 3ds_cart2_save_fix.cpp
Last active June 1, 2018 03:45
3ds Cart2 rom save remover
#include <cstdio>
#include <cstdlib>
#include <iostream>
using byte = uint8_t;
int main(int argc, const char* argv[])
{
if (argc == 2)
{
@Jakz
Jakz / ffmpeg.md
Last active February 29, 2020 15:22
ffmpeg cheat sheet

Concatenate multiple VOB into same

ffmpeg -i "concat:/Path/File1.VOB|/Path/File2.VOB" -c copy file_output.vob

Convert VOB video to x256

ffmpeg -i file_input.vob -vf yadif -c:v libx265 -preset slow -crf 20 -c:a aac -b:a 256k file_output.mkv

Cropping a video