Skip to content

Instantly share code, notes, and snippets.

@Farious
Farious / main.cpp
Last active December 16, 2019 20:44
Simple SDL2 init and usage. Shows message: _flock failed to lock maps file: errno = 35_ upon initialisation but runs normally.
//
// main.cpp
//
// Created by Fabio Reis on 16/12/2019.
//
#include <SDL2/SDL.h>
int main(int, char**) {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
@Farious
Farious / main.cpp
Created December 16, 2019 20:43
Simple SDL2 init and usage.
//
// main.cpp
//
// Created by Fabio Reis on 16/12/2019.
//
#include <SDL2/SDL.h>
int main(int, char**) {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
@Farious
Farious / rollback_aab.sh
Last active January 4, 2024 11:28
Script that will use the provided Android App Bundle (.aab) and change its version code and version name to the provided values, avoiding re-building the whole .aab. This enables us to re-submit a previously submited aab to the play store, doing a rollback to the given version.
#!/bin/sh
#
# Script that will use the provided Android App Bundle (.aab) and change its version code and version name to the provided values, avoiding re-building the whole .aab.
# Run this script with: sh rollback.sh your_project.aab android_signing_key.key key_alias key_pwd version_code version_name
#
# Necessary setup:
#
# jarsigner - This binary should exist in the path
#
# Configuration.proto and Resources.proto can be found in aapt2's github
var context = canvas.getContext("2d");
context.drawColoredImage = function(img, sx, sy, sw, sh, dx, dy, dw, dh, r, g, b) {
var buffer: Dynamic = Browser.document.createElement('canvas');
buffer.width = dw;
buffer.height = dh;
var bx = buffer.getContext('2d');
// fill offscreen buffer with the tint color
bx.fillStyle = 'rgb(' + r + ',' + g + ',' + b + ')';
bx.fillRect(0, 0, dw, dh);