- Open up your Packages folder by going Preferences >> Browse Packages...
- Create a new folder named "Pico8"
- Save the Pico8.tmLanguage file there.
#ifndef WIZ_VARIANT_H | |
#define WIZ_VARIANT_H | |
#include <cstddef> | |
#include <type_traits> | |
#include <utility> | |
namespace wiz { | |
template<std::size_t... Ns> | |
struct max_value; |
A two-pass paletted pixel-scaling algorithm that uses weighting counting of adjacent colors and a fitness function (for tie-breaking) to create a 2x scale image.
This is not an efficient implementation, just a quick-and-dirty proof of concept. So it is mainly useful for offline rendering right now, but a few optimizations to create less temporary memory and it could be made pretty quick. In particular, the best_sample
function will create a dictionary every call, resulting in a lot of garbage. This algorithm could directly work on an indexed image instead and then the weight array be a fixed-length array that is the size of the image color palette (possibly 16 or 256-color or whatever) that's shared between calls and just cleared before use, and then this should result in way fewer allocations. Also somebody could write it in a systems language like C++ or Rust instead of Python -- which would also help a lot, and hopefully wouldn't be too bad to port.
Tu
; Example: move a sprite with buttons (drawn externally during yield) | |
b0 EQU $0000 | |
b1 EQU $0001 | |
b2 EQU $0002 | |
b3 EQU $0003 | |
b4 EQU $0004 | |
b5 EQU $0005 | |
b6 EQU $0006 | |
b7 EQU $0007 | |
b8 EQU $0008 |
#ifndef CLASS_REGISTRY_H | |
#define CLASS_REGISTRY_H | |
// Uses sajson: https://github.com/chadaustin/sajson | |
#include "sajson.h" | |
#include <unordered_map> | |
#include <memory> | |
#include <limits> | |
#include <functional> |
; Variable Width Font Library | |
; | |
; by Andrew G. Crowell (@eggboycolor) | |
; | |
; -- | |
; | |
; Copyright (c) 2016 Andrew G. Crowell | |
; | |
; Permission is hereby granted, free of charge, to any person obtaining a copy of | |
; this software and associated documentation files (the "Software"), to deal in |
-- This is a dumping ground for some ideas on how to implement compiler internals for wiz. | |
-- Right now does various transformations + checks on statements and expression trees. | |
-- It's mostly for me to prototype the type-checking and code-generation stuff. | |
-- I want to dig myself out of a corner with the language, and writing this in a high-level declarative way is kinda nice. | |
-- After I'm satisfied with how it roughly works, I want to port the implementation in C++ | |
-- | |
-- In particular, I wanted to know how to handle translating expression trees into | |
-- accumulated/in-place operations on registers, and forbidding any expressions with temporaries. | |
-- | |
-- It turns out if an expression tree of left-associative operations branches only on the left side, |
#ifndef WIZ_UTILITY_VARIANT_H | |
#define WIZ_UTILITY_VARIANT_H | |
#include <cstddef> | |
#include <cassert> | |
#include <type_traits> | |
#include <utility> | |
namespace wiz { | |
namespace detail { |
#ifndef WIZ_UTILITY_INT128_H | |
#define WIZ_UTILITY_INT128_H | |
#include <cassert> | |
#include <cstdint> | |
#include <cstddef> | |
#include <cstring> | |
#include <cstdlib> | |
#include <utility> | |
#include <string> |