Skip to content

Instantly share code, notes, and snippets.

//, ________
//, + //////// \
//, /) /) H | + .
//, [ ^ ^] . + ___H__ |__
//, // ' v')__ __ ||___|___|_| +
//, ~/ \_6/_6 + |_|_____|_||
//, _____ _ / _) _) . _____Wv v _| v W____,
// `````````` lm`lm ``````` Clairvoire@gmail.com ```
// ` ` ` ` ` ` ```````````````````` `
// all code is written by me yesterday, including the testing nonsense
@Quackward
Quackward / TextureUploadEnums.h
Last active December 28, 2021 11:51
check out the bottom for a lovely surprise
#pragma once
#include "IntTypes.h"
#include "CoreGL.h"
namespace TextureFormat {
enum Type : uint8 {
// if a combo is missing, it's because it's not a required format by OpenGL
r8, rg8, rgb8, rgba8,
r16, rg16, rgb16, rgba16,
// Clairvoire@gmail.com \(v ` >`)_v
// M-maybe don't use this for anything either? It's still in need of testing and stuff
// also I OVER DOCUMENTED IT, whoops!
// Commandline how to use:
// This is an object which parses, and can also build then emit or use, a string in the following format:
//
// command argA argB argC argD target
// [command.exe] [argA's value] [1234] (nil) [How is "this?"] [path/to/target name.txt]
// Clairvoire@gmail.com \(v ` >`)_v
// returns index of first `searchStrs` we found, or `searchCount` if none was found
// str string we are searching through
// searchStrs array of sub-strings we are looking for
// searchCount the count of sub-strings we are looking for
// outStartOfArg if not NULL, fills this with pointer to first char in found search, or NULL if none found
// outEndOfArg if not NULL, fills this with pointer to first char AFTER found search, or NULL if none found
uint32 findFirstSubStr(const char * str, const char ** searchStrs, uint32 searchCount, const char ** outStartOfArg, const char ** outEndOfArg) {
if (str && searchStrs && searchCount) {
while (*str) {
// `Ratio` :: fixed point type representing values [0.0 to 1.0]
// + automatic bounds clamping
// + linear distribution of values, aligned to map cleanly with 1/2^n fractions
// - sacrifices ~1 bit of entropy;has no division operator
//
// Exponent
// | ___Mantissa___ if exponent is 1, the value is [1.0] ignoring mantissa
// | | | mantissa is always cleared if an operation produces 1.0
// 0 0 0 0 0... 0 0 0
// | | | etc... if exponent is 0, the value is [0.0 to 1.0 - epsilon]
// Clairvoire@gmail.com \(v ` >`)_v
// feel free to use as you see fit, attribution appreciated but not required, not fit for any purpose
// you'll need the following type, if you're not using glm
// struct vec3{ union{float r, x;}; union{float g, y;}; union{float b, z;}; };
// you'll need the following functions, if you're not using glm
// float abs(float x) :: returns the positive value of x
// float sin(float x) :: does the sin thing in radians
// Clairvoire@gmail.com \(v ` >`)_v
// feel free to use as you see fit, attribution appreciated but not required, not fit for any purpose
// if `lexicalCheck is false`
// returns TRUE if the printed version of a float is being approximated when we limit the print
// to a certain number of decimal places, as defined by `decimalPlaceLimit`,
// returns FALSE if the printed version is 100% accurate to the float itself.
// if `lexicalCheck is true` (expensive)
// adds the following check after the prior check, if the function is about to return TRUE:
// the value is printed using the decimal rounding, then converted back to a float;
// Clairvoire@gmail.com \(v ` >`)_v
// feel free to use as you see fit, attribution appreciated but not required, not fit for any purpose
// returns TRUE if the printed version of a float is being approximated when we limit the print
// to a certain number of decimal places, as defined by `decimalPlaceLimit`,
// returns FALSE if the printed version is 100% accurate to the float itself.
// NOTE: This WILL return true for values like 0.1, which ARE approximated at extremely
// small fractional parts in floats: 0.1 is actually 0.100000000000000005551115...
// truth table:
@echo off
:: HEYA!! batch script made by clairvoire@gmail, use however you like!
:: be sure to fulfill the below requirements!
:: * requires ffmpeg.exe in the same directory
:: Things you can change:
:: This is the appended name for the output, put anything you like here:
set convertFilenameAdd=_frameDrop
@echo off
:: HEYA!!
:: edit the next line to your aseprite.exe's complete path like ("C:/path/to/asesprite.exe") include quotes
set asepritePath="C:/Program Files (x86)/Steam/steamapps/common/Aseprite/Aseprite.exe"
:: this is the added bit to the output file's name
set convertFilenameAdd=_prev