Skip to content

Instantly share code, notes, and snippets.

@Sorebit
Sorebit / spr.sh
Created November 6, 2016 16:39
Sprawdzarka
#!/bin/bash
DIR="tests"
PRG="./app"
DIFPRG=diff
# Colordiff jeśli jest, inaczej diff
if hash colordiff 2>/dev/null; then
DIFPRG=colordiff
fi
#include <iostream>
#include <cmath>
// RGB color struct
struct Color { int r, g, b; };
// Round float to int
int round(float f) { return (f - (int)f >= 0.5) ? (f + 1) : f; }
// Returns an RGB color from an HSV one
// @Makefile
// all:
// mkdir -p sprites
// g++ -std=c++11 lodepng/lodepng.cpp sprites.cpp -Wall -pedantic -O3 -o squad
//
// The lib can be found at https://github.com/lvandeve/lodepng
// The output will be stored in ./sprites/ as *.png files
// sprites.cpp - sorbet, https://github.com/Sorebit
#include "lodepng/lodepng.h"
#include <iostream>