Skip to content

Instantly share code, notes, and snippets.

View DragoniteSpam's full-sized avatar
🐉
I like dragons

Michael DragoniteSpam

🐉
I like dragons
View GitHub Profile
enum InputVerbs {
A, B, X, Y,
LEFT, RIGHT, UP, DOWN,
LOOK_LEFT, LOOK_RIGHT, LOOK_UP, LOOK_DOWN,
PAD_LEFT, PAD_RIGHT, PAD_UP, PAD_DOWN,
PAUSE, UNPAUSE, RUN,
FRIEND_ATTACK,
FRIEND_DEFEND,
SHOULDERR2, // unused
SPELL_FIRE, SPELL_WATER, SPELL_THUNDER,
function draw_ngon(x, y, n, length, rot) {
draw_primitive_begin(pr_trianglefan);
draw_vertex_colour(x, y, c_white, 1);
for (var i = 0; i <= n; i++) {
var angle = 2 * pi / n * i + rot;
draw_vertex_colour(x + length * cos(angle), y - length * sin(angle), make_colour_hsv(255 / (n + 1) * i, 255, 255), 1);
}
draw_primitive_end();
}
@DragoniteSpam
DragoniteSpam / tilemap_to_vertex_buffer.gml
Created March 29, 2021 23:46
convert a game maker tilemap to a vertex buffer
function tilemap_to_vertex_buffer(tilemap, format) {
// vertex format: position, normal, texture
var vbuff = vertex_create_buffer();
vertex_begin(vbuff, format);
var ts_tileset = tilemap_get_tileset(tilemap);
var ts_tex = tileset_get_texture(ts_tileset);
var ts_uvs = tileset_get_uvs(ts_tileset);
var ts_tex_width = texture_get_texel_width(ts_tex);
var ts_tex_height = texture_get_texel_height(ts_tex);
var ts_tile_width = tilemap_get_tile_width(tilemap);
// Feather disable all
// @ignore
/*
function Drago3D_Internals() {
static Vertex = function(vbuff, x, y, z, nx, ny, nz, u, v, c, a) {
vertex_position_3d(vbuff, x, y, z);
vertex_normal(vbuff, nx, ny, nz);
vertex_colour(vbuff, c, a);
vertex_texcoord(vbuff, u, v);
};
@DragoniteSpam
DragoniteSpam / shd_fxaa.fsh
Created April 11, 2025 23:23
FXAA shader, gamemaker-ified
/**
Basic FXAA implementation based on the code on geeks3d.com with the
modification that the texture2DLod stuff was removed since it's
unsupported by WebGL.
GameMaker-ized by dragonitespam.
--
From: